Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (g762) fix call to devm_hwmon_device_register_with_groups()

g762_remove() needs to first call hwmon_device_unregister() and then
g762_of_clock_disable(). For that reason, it is not possible to
convert it to devm_hwmon_device_register_with_groups() and the
the non device managed version must be used.

This is correctly stated in commit message for 398e16db6262 ("hwmon:
(g762) Convert to hwmon_device_register_with_groups") but the
associated changes do in fact introduce a call to the device managed
version of the function.

This patch fixes that typo by switching to the non devm_ version.

Fixes: 398e16db6262 ("hwmon: (g762) Convert to hwmon_device_register_with_groups")
Cc: stable@vger.kernel.org (3.17+)
Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Arnaud Ebalard and committed by
Guenter Roeck
6b19b660 fc14f9c1

+2 -4
+2 -4
drivers/hwmon/g762.c
··· 1084 1084 if (ret) 1085 1085 goto clock_dis; 1086 1086 1087 - data->hwmon_dev = devm_hwmon_device_register_with_groups(dev, 1088 - client->name, 1089 - data, 1090 - g762_groups); 1087 + data->hwmon_dev = hwmon_device_register_with_groups(dev, client->name, 1088 + data, g762_groups); 1091 1089 if (IS_ERR(data->hwmon_dev)) { 1092 1090 ret = PTR_ERR(data->hwmon_dev); 1093 1091 goto clock_dis;