revisiting __SENSOR_DEVICE_ATTR() and array initialization

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

 



Jean, everyone

back in pre-14 days, I proposed a set of patches to hwmon/pc87360.c
Id like to revisit the parts that didnt make it into 2.6.14,
and see whether it might be consistent with some of Greg KHs
longer term plans for sysfs rework  LWN 12/1

So, attached (sorry) is a patch (for discussion purposes), doing:

hwmon-sysfs.h:

gets a new __SENSOR_DEVICE_ATTR, which expands into an initialization, 
like so:

+#define SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index)    \
+struct sensor_device_attribute sensor_dev_attr_##_name         \
+       = __SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index)


pc87360.c:

replaces many uses of SENSOR_DEVICE_ATTR with
struct sensor_device_attribute array[] = { ..} 
declarations and initializations using the new macro,
and rolls lists of device_create_file into loops over those arrays.

Also includes a few macros that probly arent general enough for a .h,
but are useful abbreviations here


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff.SDA-1-okcomp
Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20051209/0b08065c/attachment.pl 


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

  Powered by Linux