sfc: Convert to use hwmon_device_register_with_groups
Subsystems (3)
PATCH 1/1 sfc: Convert to use hwmon_device_register_with_groups
Simplify the code. Avoid race conditions caused by attributes being created after hwmon device registration. Implicitly (through hwmon API) add mandatory 'name' sysfs attribute.
Signed-off-by Guenter Roeck <[email protected]>
---
Compile tested only.
drivers/net/ethernet/sfc/mcdi.h | 2 + drivers/net/ethernet/sfc/mcdi_mon.c | 76 +++++++++++++---------------------- 2 files changed, 31 insertions(+), 47 deletions(-)
drivers/net/ethernet/sfc/mcdi.h +2 -0
@@ -75,6 +75,8 @@ struct efx_mcdi_mon {unsigned long last_update;struct device *device;struct efx_mcdi_mon_attribute *attrs; +struct attribute_group group; +const struct attribute_group *groups[2 ];unsigned int n_attrs; };
drivers/net/ethernet/sfc/mcdi_mon.c +29 -47
173 lines not on this page · raw message
Signature · 7 lines
1.7.9.7 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 8 lines · Guenter Roeck
Simplify the code. Avoid race conditions caused by attributes being created after hwmon device registration. Implicitly (through hwmon API) add mandatory 'name' sysfs attribute.
Signed-off-by Guenter Roeck <[email protected]>---
Compile tested only.
Sorry for the noise if you see this patch multiple times. My send script tried to annoy me.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors