lkml.org 
[lkml]   [1999]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.059 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site