EmbLogic's Blog

problem regarding to container_of()

local_dev=container_of(inode->i_cdev, struct scull_dev,cdev1);
in above function, i don’t know how container_of() give the minor number and also how assign global device to local device.

2 Responses to problem regarding to container_of()

  1. it dosnt give minor no. it returns the pointer which contains the cdev structure if cdev is the last (3rd) argument

  2. it dosnt give minor no. it returns the pointer of the structure(scull_dev) which contains the cdev structure if cdev is the last (3rd) argument.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>