Skip to contentSkip to conversation

Accessing the dev_private field of the RTDM driver context

Xenomai-help Jeroen Van den Keybus 2 participants 3 messages Feb 22, 2006

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw
Quoted 14 lines · Jeroen Van den Keybus

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:

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