Skip to content

Commit

Permalink
hwmon: (g762) fix call to devm_hwmon_device_register_with_groups()
Browse files Browse the repository at this point in the history
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 398e16d ("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: 398e16d ("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>
  • Loading branch information
Arnaud Ebalard authored and Guenter Roeck committed Nov 19, 2014
1 parent fc14f9c commit 6b19b66
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/hwmon/g762.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,10 +1084,8 @@ static int g762_probe(struct i2c_client *client, const struct i2c_device_id *id)
if (ret)
goto clock_dis;

data->hwmon_dev = devm_hwmon_device_register_with_groups(dev,
client->name,
data,
g762_groups);
data->hwmon_dev = hwmon_device_register_with_groups(dev, client->name,
data, g762_groups);
if (IS_ERR(data->hwmon_dev)) {
ret = PTR_ERR(data->hwmon_dev);
goto clock_dis;
Expand Down

0 comments on commit 6b19b66

Please sign in to comment.