Messages in this thread | | | Date | Fri, 26 Nov 1999 14:15:20 -0700 | From | Richard Gooch <> | Subject | Re: Request for comments (kdev_t and friends...) |
| |
Oliver Xymoron writes: > In fact, we should add at least a void *private so that devices can > be freed of managing their instance data with static arrays indexed > off minor number.
With devfs this is really clean. A driver can allocate an instance structure at probe time, and pass the pointer to devfs_register(). When the device node is opened, file->private_data is initialised with that pointer. So the driver open() method already has a handle to the device instance structure, without any lookups being required.
If you have a group of devices which are related (i.e. one card, several device nodes, separate card has a different "group"), each instance structure can have a pointer to the "parent" group instance structure (one per card, for example). No mess, no fuss. Much easier to grok than the old scheme.
Regards,
Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |