local_scull_dev_ptr=container_of(pointer,container type,cdev);
anyone plz tell me the internal functioning of the this macro…
1.what i mean to say is- how the control moves…
2.we directly take the third argument as ‘cdev’…
but we know cdev resides in struct scull_dev
so we should take ‘local_scull_dev_ptr->cdev’ as a third argument…
container_of is just a API used to shifts the pointer which pointing the current structure to the structure which contains the current structure
Here is the prototype of Container_of
container_of(pointer variable,type of container structure,current structure type);