]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Merge tag 'hwmon-for-linus-v4.15-take2' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Nov 2017 04:10:05 +0000 (20:10 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Nov 2017 04:10:05 +0000 (20:10 -0800)
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

drivers/hwmon/k10temp.c
drivers/hwmon/w83781d.c
drivers/hwmon/w83791d.c
drivers/hwmon/w83792d.c
drivers/hwmon/w83793.c

index 46a54ed234105040ecda4644cadeb48d6639aca2..0721e175664aee9fece8a8546c6f41936a7febde 100644 (file)
@@ -81,7 +81,7 @@ struct tctl_offset {
 };
 
 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 1800X", 20000 },
        { 0x17, "AMD Ryzen Threadripper 1950X", 27000 },
index 246fb2365126b5b013c2df0b09ef54841e91a4a9..2b0f182daa8752fd0e7b54f91c4ac53d13a2ccba 100644 (file)
@@ -1246,10 +1246,8 @@ w83781d_probe(struct i2c_client *client, const struct i2c_device_id *id)
 
  exit_remove_files:
        w83781d_remove_files(dev);
-       if (data->lm75[0])
-               i2c_unregister_device(data->lm75[0]);
-       if (data->lm75[1])
-               i2c_unregister_device(data->lm75[1]);
+       i2c_unregister_device(data->lm75[0]);
+       i2c_unregister_device(data->lm75[1]);
        return err;
 }
 
@@ -1262,10 +1260,8 @@ w83781d_remove(struct i2c_client *client)
        hwmon_device_unregister(data->hwmon_dev);
        w83781d_remove_files(dev);
 
-       if (data->lm75[0])
-               i2c_unregister_device(data->lm75[0]);
-       if (data->lm75[1])
-               i2c_unregister_device(data->lm75[1]);
+       i2c_unregister_device(data->lm75[0]);
+       i2c_unregister_device(data->lm75[1]);
 
        return 0;
 }
index 8af6081b4ab418c16008ac8c958a2aee49b45f8e..28fa3bd2c0961449e4edd14cc30f3ba2dc8fc007 100644 (file)
@@ -1316,8 +1316,7 @@ static int w83791d_detect_subclients(struct i2c_client *client)
 /* Undo inits in case of errors */
 
 error_sc_1:
-       if (data->lm75[0] != NULL)
-               i2c_unregister_device(data->lm75[0]);
+       i2c_unregister_device(data->lm75[0]);
 error_sc_0:
        return err;
 }
@@ -1434,10 +1433,8 @@ error5:
 error4:
        sysfs_remove_group(&client->dev.kobj, &w83791d_group);
 error3:
-       if (data->lm75[0] != NULL)
-               i2c_unregister_device(data->lm75[0]);
-       if (data->lm75[1] != NULL)
-               i2c_unregister_device(data->lm75[1]);
+       i2c_unregister_device(data->lm75[0]);
+       i2c_unregister_device(data->lm75[1]);
        return err;
 }
 
@@ -1448,10 +1445,8 @@ static int w83791d_remove(struct i2c_client *client)
        hwmon_device_unregister(data->hwmon_dev);
        sysfs_remove_group(&client->dev.kobj, &w83791d_group);
 
-       if (data->lm75[0] != NULL)
-               i2c_unregister_device(data->lm75[0]);
-       if (data->lm75[1] != NULL)
-               i2c_unregister_device(data->lm75[1]);
+       i2c_unregister_device(data->lm75[0]);
+       i2c_unregister_device(data->lm75[1]);
 
        return 0;
 }
index d764602d70dbef20b251ac0e74281afd934e52ec..76aa39e537e0306930bd207f1ef53540458a08fc 100644 (file)
@@ -981,8 +981,7 @@ w83792d_detect_subclients(struct i2c_client *new_client)
 /* Undo inits in case of errors */
 
 ERROR_SC_1:
-       if (data->lm75[0] != NULL)
-               i2c_unregister_device(data->lm75[0]);
+       i2c_unregister_device(data->lm75[0]);
 ERROR_SC_0:
        return err;
 }
@@ -1456,10 +1455,8 @@ exit_remove_files:
        for (i = 0; i < ARRAY_SIZE(w83792d_group_fan); i++)
                sysfs_remove_group(&dev->kobj, &w83792d_group_fan[i]);
 exit_i2c_unregister:
-       if (data->lm75[0] != NULL)
-               i2c_unregister_device(data->lm75[0]);
-       if (data->lm75[1] != NULL)
-               i2c_unregister_device(data->lm75[1]);
+       i2c_unregister_device(data->lm75[0]);
+       i2c_unregister_device(data->lm75[1]);
        return err;
 }
 
@@ -1475,10 +1472,8 @@ w83792d_remove(struct i2c_client *client)
                sysfs_remove_group(&client->dev.kobj,
                                   &w83792d_group_fan[i]);
 
-       if (data->lm75[0] != NULL)
-               i2c_unregister_device(data->lm75[0]);
-       if (data->lm75[1] != NULL)
-               i2c_unregister_device(data->lm75[1]);
+       i2c_unregister_device(data->lm75[0]);
+       i2c_unregister_device(data->lm75[1]);
 
        return 0;
 }
index 5ba9d9f1daa1f5f65933edd58bc32adb8525e10b..0af0f6283b353f36a9344a189660426642ef17fa 100644 (file)
@@ -1564,10 +1564,8 @@ static int w83793_remove(struct i2c_client *client)
        for (i = 0; i < ARRAY_SIZE(w83793_temp); i++)
                device_remove_file(dev, &w83793_temp[i].dev_attr);
 
-       if (data->lm75[0] != NULL)
-               i2c_unregister_device(data->lm75[0]);
-       if (data->lm75[1] != NULL)
-               i2c_unregister_device(data->lm75[1]);
+       i2c_unregister_device(data->lm75[0]);
+       i2c_unregister_device(data->lm75[1]);
 
        /* Decrease data reference counter */
        mutex_lock(&watchdog_data_mutex);
@@ -1625,8 +1623,7 @@ w83793_detect_subclients(struct i2c_client *client)
        /* Undo inits in case of errors */
 
 ERROR_SC_1:
-       if (data->lm75[0] != NULL)
-               i2c_unregister_device(data->lm75[0]);
+       i2c_unregister_device(data->lm75[0]);
 ERROR_SC_0:
        return err;
 }
@@ -1962,10 +1959,8 @@ exit_remove:
        for (i = 0; i < ARRAY_SIZE(w83793_temp); i++)
                device_remove_file(dev, &w83793_temp[i].dev_attr);
 
-       if (data->lm75[0] != NULL)
-               i2c_unregister_device(data->lm75[0]);
-       if (data->lm75[1] != NULL)
-               i2c_unregister_device(data->lm75[1]);
+       i2c_unregister_device(data->lm75[0]);
+       i2c_unregister_device(data->lm75[1]);
 free_mem:
        kfree(data);
 exit: