diff options
author | Guenter Roeck <linux@roeck-us.net> | 2013-07-11 23:00:12 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2013-10-13 19:16:28 -0400 |
commit | 74188cba088192e14cd7fd5433876e8c947bcdd8 (patch) | |
tree | a57d582ea4a75155a169b0dede83f5eed3c2e9b1 /include/linux/hwmon.h | |
parent | 615fc8cb0f900c91ee50f0da0a1821a7c6823671 (diff) |
hwmon: Provide managed hwmon registration
Drivers using the new hwmon_device_register_with_groups API often have a
remove function which consists solely of a call hwmon_device_unregister().
Provide support for devm_hwmon_device_register_with_groups and
devm_hwmon_device_unregister to allow this repeated code to be removed
and help eliminate error handling code.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/linux/hwmon.h')
-rw-r--r-- | include/linux/hwmon.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index 6d02ff77ae1a..09354f6c1d63 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h | |||
@@ -22,7 +22,12 @@ struct device * | |||
22 | hwmon_device_register_with_groups(struct device *dev, const char *name, | 22 | hwmon_device_register_with_groups(struct device *dev, const char *name, |
23 | void *drvdata, | 23 | void *drvdata, |
24 | const struct attribute_group **groups); | 24 | const struct attribute_group **groups); |
25 | struct device * | ||
26 | devm_hwmon_device_register_with_groups(struct device *dev, const char *name, | ||
27 | void *drvdata, | ||
28 | const struct attribute_group **groups); | ||
25 | 29 | ||
26 | void hwmon_device_unregister(struct device *dev); | 30 | void hwmon_device_unregister(struct device *dev); |
31 | void devm_hwmon_device_unregister(struct device *dev); | ||
27 | 32 | ||
28 | #endif | 33 | #endif |