Commit d9ef1ccf authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'hwmon-for-linus-v4.15-take2' of...

Merge tag 'hwmon-for-linus-v4.15-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull more hwmon updates/fixes from Guenter Roeck:

 - minor bug fix in k10temp driver

 - take advantage of added NULL check in i2c_unregister_device()

* tag 'hwmon-for-linus-v4.15-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (w83793) Remove duplicate NULL check
  hwmon: (w83792d) Remove duplicate NULL check
  hwmon: (w83791d) Remove duplicate NULL check
  hwmon: (w83781d) Remove duplicate NULL check
  hwmon: (k10temp) Correct model name for Ryzen 1600X
parents fc35c196 7adce422
...@@ -81,7 +81,7 @@ struct tctl_offset { ...@@ -81,7 +81,7 @@ struct tctl_offset {
}; };
static const struct tctl_offset tctl_offset_table[] = { static const struct tctl_offset tctl_offset_table[] = {
{ 0x17, "AMD Ryzen 7 1600X", 20000 }, { 0x17, "AMD Ryzen 5 1600X", 20000 },
{ 0x17, "AMD Ryzen 7 1700X", 20000 }, { 0x17, "AMD Ryzen 7 1700X", 20000 },
{ 0x17, "AMD Ryzen 7 1800X", 20000 }, { 0x17, "AMD Ryzen 7 1800X", 20000 },
{ 0x17, "AMD Ryzen Threadripper 1950X", 27000 }, { 0x17, "AMD Ryzen Threadripper 1950X", 27000 },
......
...@@ -1246,10 +1246,8 @@ w83781d_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -1246,10 +1246,8 @@ w83781d_probe(struct i2c_client *client, const struct i2c_device_id *id)
exit_remove_files: exit_remove_files:
w83781d_remove_files(dev); w83781d_remove_files(dev);
if (data->lm75[0]) i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]); i2c_unregister_device(data->lm75[1]);
if (data->lm75[1])
i2c_unregister_device(data->lm75[1]);
return err; return err;
} }
...@@ -1262,10 +1260,8 @@ w83781d_remove(struct i2c_client *client) ...@@ -1262,10 +1260,8 @@ w83781d_remove(struct i2c_client *client)
hwmon_device_unregister(data->hwmon_dev); hwmon_device_unregister(data->hwmon_dev);
w83781d_remove_files(dev); w83781d_remove_files(dev);
if (data->lm75[0]) i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]); i2c_unregister_device(data->lm75[1]);
if (data->lm75[1])
i2c_unregister_device(data->lm75[1]);
return 0; return 0;
} }
......
...@@ -1316,8 +1316,7 @@ static int w83791d_detect_subclients(struct i2c_client *client) ...@@ -1316,8 +1316,7 @@ static int w83791d_detect_subclients(struct i2c_client *client)
/* Undo inits in case of errors */ /* Undo inits in case of errors */
error_sc_1: error_sc_1:
if (data->lm75[0] != NULL) i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]);
error_sc_0: error_sc_0:
return err; return err;
} }
...@@ -1434,10 +1433,8 @@ static int w83791d_probe(struct i2c_client *client, ...@@ -1434,10 +1433,8 @@ static int w83791d_probe(struct i2c_client *client,
error4: error4:
sysfs_remove_group(&client->dev.kobj, &w83791d_group); sysfs_remove_group(&client->dev.kobj, &w83791d_group);
error3: error3:
if (data->lm75[0] != NULL) i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]); i2c_unregister_device(data->lm75[1]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
return err; return err;
} }
...@@ -1448,10 +1445,8 @@ static int w83791d_remove(struct i2c_client *client) ...@@ -1448,10 +1445,8 @@ static int w83791d_remove(struct i2c_client *client)
hwmon_device_unregister(data->hwmon_dev); hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &w83791d_group); sysfs_remove_group(&client->dev.kobj, &w83791d_group);
if (data->lm75[0] != NULL) i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]); i2c_unregister_device(data->lm75[1]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
return 0; return 0;
} }
......
...@@ -981,8 +981,7 @@ w83792d_detect_subclients(struct i2c_client *new_client) ...@@ -981,8 +981,7 @@ w83792d_detect_subclients(struct i2c_client *new_client)
/* Undo inits in case of errors */ /* Undo inits in case of errors */
ERROR_SC_1: ERROR_SC_1:
if (data->lm75[0] != NULL) i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]);
ERROR_SC_0: ERROR_SC_0:
return err; return err;
} }
...@@ -1456,10 +1455,8 @@ w83792d_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -1456,10 +1455,8 @@ w83792d_probe(struct i2c_client *client, const struct i2c_device_id *id)
for (i = 0; i < ARRAY_SIZE(w83792d_group_fan); i++) for (i = 0; i < ARRAY_SIZE(w83792d_group_fan); i++)
sysfs_remove_group(&dev->kobj, &w83792d_group_fan[i]); sysfs_remove_group(&dev->kobj, &w83792d_group_fan[i]);
exit_i2c_unregister: exit_i2c_unregister:
if (data->lm75[0] != NULL) i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]); i2c_unregister_device(data->lm75[1]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
return err; return err;
} }
...@@ -1475,10 +1472,8 @@ w83792d_remove(struct i2c_client *client) ...@@ -1475,10 +1472,8 @@ w83792d_remove(struct i2c_client *client)
sysfs_remove_group(&client->dev.kobj, sysfs_remove_group(&client->dev.kobj,
&w83792d_group_fan[i]); &w83792d_group_fan[i]);
if (data->lm75[0] != NULL) i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]); i2c_unregister_device(data->lm75[1]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
return 0; return 0;
} }
......
...@@ -1564,10 +1564,8 @@ static int w83793_remove(struct i2c_client *client) ...@@ -1564,10 +1564,8 @@ static int w83793_remove(struct i2c_client *client)
for (i = 0; i < ARRAY_SIZE(w83793_temp); i++) for (i = 0; i < ARRAY_SIZE(w83793_temp); i++)
device_remove_file(dev, &w83793_temp[i].dev_attr); device_remove_file(dev, &w83793_temp[i].dev_attr);
if (data->lm75[0] != NULL) i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]); i2c_unregister_device(data->lm75[1]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
/* Decrease data reference counter */ /* Decrease data reference counter */
mutex_lock(&watchdog_data_mutex); mutex_lock(&watchdog_data_mutex);
...@@ -1625,8 +1623,7 @@ w83793_detect_subclients(struct i2c_client *client) ...@@ -1625,8 +1623,7 @@ w83793_detect_subclients(struct i2c_client *client)
/* Undo inits in case of errors */ /* Undo inits in case of errors */
ERROR_SC_1: ERROR_SC_1:
if (data->lm75[0] != NULL) i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]);
ERROR_SC_0: ERROR_SC_0:
return err; return err;
} }
...@@ -1962,10 +1959,8 @@ static int w83793_probe(struct i2c_client *client, ...@@ -1962,10 +1959,8 @@ static int w83793_probe(struct i2c_client *client,
for (i = 0; i < ARRAY_SIZE(w83793_temp); i++) for (i = 0; i < ARRAY_SIZE(w83793_temp); i++)
device_remove_file(dev, &w83793_temp[i].dev_attr); device_remove_file(dev, &w83793_temp[i].dev_attr);
if (data->lm75[0] != NULL) i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]); i2c_unregister_device(data->lm75[1]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
free_mem: free_mem:
kfree(data); kfree(data);
exit: exit:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment