Format: void * create(void)
This is called when the device is created by the device configuration directive. The function should allocate a structure for data storage for this instance of the device. A pointer (cast to void * ) to this structure should be returned.
struct context {
unsigned int foo;
float bar;
char lala[30];
};
void *create(void)
{
struct context *ctx;
ctx = malloc(sizeof(struct context));
return (void *)ctx;
}