Skip to contentSkip to conversation

sfc: Convert to use hwmon_device_register_with_groups

PATCH Applied Guenter Roeck 2 participants 2 messages Nov 28, 2013 – Nov 29, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
index 656a327..15816ca 100644
@@ -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
maintainer Applied
#1 lore raw

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.

Applied, thanks.

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors