sfc: Convert to use hwmon_device_register_with_groups
Subsystems (3)
PATCH v2 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.
---
v2: Fix wrong dev_get_drvdata dereference in efx_mcdi_mon_get_entry()
drivers/net/ethernet/sfc/mcdi.h | 2 + drivers/net/ethernet/sfc/mcdi_mon.c | 78 ++++++++++++++--------------------- 2 files changed, 32 insertions(+), 48 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 +30 -48
178 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
From: Guenter Roeck <[email protected]>
Date: Wed, 27 Nov 2013 18:54:31 -0800
Quoted 6 lines
Simplify the code. Avoid race conditions caused by attributes being created after hwmon device registration. Implicitly (through hwmon API) add mandatory 'name' sysfs attribute.
Reviewed-by Ben Hutchings <[email protected]>Signed-off-by Guenter Roeck <[email protected]>
Applied, thanks.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors