[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/5/05, Yani Ioannou <yani.ioannou at gmail.com> wrote:
> > Wait, are you only changing the device attribute?  What about the
> > general sysfs attributes?  That is where this should be changed.
> >
> > thanks,
> >
> > greg k-h
> >
> 
> Yes my patch changes the device attributes simply because that's all I
> ever worked with, but I can see this benefiting all sysfs attributes,
> I'll make the change and change __ATTR.

Here is a much more ambitious patch that inserts the void * into the
general sysfs attribute, updates the __ATTR and ATTR_RO macros to
automatically set it to NULL and updates all the derived attributes
(that I can identify anyway) to pass it to their sysfs callbacks. If
nobody has any objections/improvements to this patch I will submit a
(rather large) patch mainly generated by my updated perl script to
remove the warnings this causes on any code that defines sysfs
callbacks.

We would probably want to define another DEVICE_ATTRIBUTE like macro
or add a void * parameter to the DEVICE_ATTRIBUTE macro. Any opinions
on which way to go? This might be done for the other *_ATTRIBUTE
macros too.

I noticed as I was going through the kernel source that implements
sysfs attributes that a lot of non-i2c drivers and even a lot of
non-driver code could benefit from this patch, it would be interesting
to see how much this patch could reduce the kernel size. A lot of work
would have to be done before that is realized though in updating code
to take advantage of it.

Thanks,
Yani
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-linux-2.6.12-rc3-sysfsdyncallback-core.diff
Type: text/x-patch
Size: 17264 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050506/344c3d90/attachment.bin 


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

  Powered by Linux