Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7adce422 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Guenter Roeck
Browse files

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent c85a78b0
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -1564,9 +1564,7 @@ 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]);

	/* Decrease data reference counter */
@@ -1625,7 +1623,6 @@ 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]);
ERROR_SC_0:
	return err;
@@ -1962,9 +1959,7 @@ static int w83793_probe(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]);
free_mem:
	kfree(data);