From: Andy Shevchenko Date: Tue, 31 Oct 2017 14:21:44 +0000 (+0200) Subject: hwmon: (w83791d) Remove duplicate NULL check X-Git-Tag: v4.15-rc1~47^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=416c2a6a6ba96926ef585b574f509e1c6c6440ab;p=thirdparty%2Flinux.git hwmon: (w83791d) Remove duplicate NULL check Since i2c_unregister_device() became NULL-aware we may remove duplicate NULL check. Cc: Marc Hulsman Cc: Jean Delvare Cc: Guenter Roeck Cc: linux-hwmon@vger.kernel.org Signed-off-by: Andy Shevchenko Reviewed-by: Jean Delvare Signed-off-by: Guenter Roeck --- diff --git a/drivers/hwmon/w83791d.c b/drivers/hwmon/w83791d.c index 8af6081b4ab41..28fa3bd2c0961 100644 --- a/drivers/hwmon/w83791d.c +++ b/drivers/hwmon/w83791d.c @@ -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; }