Accessing the dev_private field of the RTDM driver context
The dev_private data field of an rtdm_dev_context is defined as char[0]. How do I access such a field properly (given the fact that I defined a nonzero context_size in the rtdm_device structure during driver registration) ?
E.g. trying to do:
(struct my_struct *)context->dev_private = NULL;
results in:
error: incompatible types in assignment
I _am_ able to compare though:
if ((struct my_struct *)context->dev_private == NULL)
...
seems to compile fine.
Jeroen.
Quoted 14 lines · Jeroen Van den Keybus
The
dev_privatedata field of anrtdm_dev_contextis defined as char[0]. How do I access such a field properly (given the fact that I defined a nonzerocontext_sizein thertdm_devicestructure during driver registration) ?E.g. trying to do:
(struct
my_struct*)context->dev_private = NULL;results in:
error: incompatible types in assignment
I _am_ able to compare though:
Quoted 8 lines
if ((struct
my_struct*)context->dev_private == NULL)
...seems to compile fine.
Jeroen.
context->dev_private does not contain an address, it IS the start address of your private date. It's size is specified during device registration. See existing drivers for usage examples.
Jan
Indeed. Thanks and sorry for bothering.
Jeroen.