[RFC PATCH 2.6.12-rc3] dynamic driver sysfs callbacks and RFC on bmcsensor rewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/9/05, Dmitry Torokhov <dtor_core at ameritech.net> wrote:
> On Monday 09 May 2005 00:01, Yani Ioannou wrote:
> > Hi Dmitry,
> >
> > On 5/8/05, Dmitry Torokhov <dtor_core at ameritech.net> wrote:
> > > Hi Yani,
> > >
> > > Yes, I see what you mean. But I think what we might need is actually 2
> > > void * pointers, something like "attribute_data" and "instance_data".
> > > Macros would initialize "attribute_data" but not "instance_data". This
> > > way their usage is clearly defined and there hopefully less confusion.
> > >
> > > --
> > > Dmitry
> > >
> >
> > The naming might make the distinction in use, but nothing is really
> > stopping anyone from using one or the other and it might even confuse
> > further (i.e. not understanding the difference, using both, using the
> > wrong one). Since the two would be mutually exclusive
> 
> Why would they? Consider something like generic show function you give
> it a pointer to data you want to be printed in instance_data and a pointer
> to format string in attribute_data and that's it.

Each `instance' would have to have it's own sysfs attribute (i.e.
non-static/shared) to be able to set an instance specific pointer
anyway, and so setting attribute_data for bother of those really
doesn't make any sense to me. If you are looking to pass two (or more)
pointers as in your example, just create a single struct containing
them and point to it (although I'm trying not to do something like
that in net-sysfs.c).

Yani



[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux