diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-10-31 10:21:43 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2017-11-16 04:01:55 -0500 |
commit | 0ab21d0edb5deba027460961baf49433246853db (patch) | |
tree | c91800bed29f852b8a6ee2f75642eccbc8f92ec8 | |
parent | ab5ee24615f9dd8b0cd199403959f8b13309e7b1 (diff) |
hwmon: (w83781d) Remove duplicate NULL check
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>
-rw-r--r-- | drivers/hwmon/w83781d.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index 246fb2365126..2b0f182daa87 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c | |||
@@ -1246,10 +1246,8 @@ w83781d_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1246 | 1246 | ||
1247 | exit_remove_files: | 1247 | exit_remove_files: |
1248 | w83781d_remove_files(dev); | 1248 | w83781d_remove_files(dev); |
1249 | if (data->lm75[0]) | 1249 | i2c_unregister_device(data->lm75[0]); |
1250 | i2c_unregister_device(data->lm75[0]); | 1250 | i2c_unregister_device(data->lm75[1]); |
1251 | if (data->lm75[1]) | ||
1252 | i2c_unregister_device(data->lm75[1]); | ||
1253 | return err; | 1251 | return err; |
1254 | } | 1252 | } |
1255 | 1253 | ||
@@ -1262,10 +1260,8 @@ w83781d_remove(struct i2c_client *client) | |||
1262 | hwmon_device_unregister(data->hwmon_dev); | 1260 | hwmon_device_unregister(data->hwmon_dev); |
1263 | w83781d_remove_files(dev); | 1261 | w83781d_remove_files(dev); |
1264 | 1262 | ||
1265 | if (data->lm75[0]) | 1263 | i2c_unregister_device(data->lm75[0]); |
1266 | i2c_unregister_device(data->lm75[0]); | 1264 | i2c_unregister_device(data->lm75[1]); |
1267 | if (data->lm75[1]) | ||
1268 | i2c_unregister_device(data->lm75[1]); | ||
1269 | 1265 | ||
1270 | return 0; | 1266 | return 0; |
1271 | } | 1267 | } |