Skip to contentSkip to conversation

sfc: Convert to use hwmon_device_register_with_groups

PATCH In review Guenter Roeck 1 participant 2 messages Nov 27, 2013

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

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.

---
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
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 +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
#1 lore raw
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.

---
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