summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-07-12 03:00:12 (GMT)
committerMatthew Weigel <Matthew.Weigel@freescale.com>2014-12-11 18:36:09 (GMT)
commit4e9f0c4a3adf7800f06f3493cc6cd44ac7bef414 (patch)
tree52280edc749403c90ea230a0ccc165078c2d0241 /include/linux
parent3e9d7e053a10d91525920b9ce03e1579976f25d4 (diff)
downloadlinux-fsl-qoriq-4e9f0c4a3adf7800f06f3493cc6cd44ac7bef414.tar.xz
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> (cherry picked from commit 74188cba088192e14cd7fd5433876e8c947bcdd8) Change-Id: I7a2eca21e6a32bacbc55a979b630f10d19508abc Reviewed-on: http://git.am.freescale.net:8181/19632 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Zhengxiong Jin <Jason.Jin@freescale.com> Tested-by: Zhengxiong Jin <Jason.Jin@freescale.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hwmon.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h
index 6d02ff7..09354f6 100644
--- a/include/linux/hwmon.h
+++ b/include/linux/hwmon.h
@@ -22,7 +22,12 @@ struct device *
hwmon_device_register_with_groups(struct device *dev, const char *name,
void *drvdata,
const struct attribute_group **groups);
+struct device *
+devm_hwmon_device_register_with_groups(struct device *dev, const char *name,
+ void *drvdata,
+ const struct attribute_group **groups);
void hwmon_device_unregister(struct device *dev);
+void devm_hwmon_device_unregister(struct device *dev);
#endif