]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
hwmon: (w83781d) Remove duplicate NULL check
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 31 Oct 2017 14:21:43 +0000 (16:21 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 16 Nov 2017 09:01:55 +0000 (01:01 -0800)
Since i2c_unregister_device() became NULL-aware we may remove duplicate
NULL check.

Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/w83781d.c

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;
 }