hwmon: (w83793) Remove duplicate NULL check
Since i2c_unregister_device() became NULL-aware we may remove duplicate NULL check. Cc: Rudolf Marek <r.marek@assembler.cz> 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> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
c85a78b078
commit
7adce422dd
1 changed files with 5 additions and 10 deletions
|
@ -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)
|
||||||
/* 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,
|
||||||
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:
|
||||||
|
|
Loading…
Add table
Reference in a new issue