]> git.openpandora.org Git - pandora-kernel.git/commitdiff
sfc: Convert to use hwmon_device_register_with_groups
authorGuenter Roeck <linux@roeck-us.net>
Thu, 28 Nov 2013 02:54:31 +0000 (18:54 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 Nov 2013 21:26:16 +0000 (16:26 -0500)
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 <bhutchings@solarflare.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/mcdi.h
drivers/net/ethernet/sfc/mcdi_mon.c

index 656a3277c2b210e69ffd028d059ce10b809e8db8..15816cacb548161bd4a7299909bb83ccd9c222be 100644 (file)
@@ -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;
 };
 
Simple merge