From 74188cba088192e14cd7fd5433876e8c947bcdd8 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Thu, 11 Jul 2013 20:00:12 -0700 Subject: 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 --- include/linux/hwmon.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux/hwmon.h') 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 * 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 -- cgit v1.2.3-59-g8ed1b