Skip to contentSkip to conversation

hwmon/emc1403: remove unnecessary hwmon_device_unregister

PATCH Applied Yong Wang 3 participants 3 messages Sep 14, 2010 Hardware monitoring

lore
Share & tools
lore

Yong Wang

author
#0 lore raw

PATCH 1/1 hwmon/emc1403: remove unnecessary hwmon_device_unregister

It is unnecessary to call hwmon_device_unregister in error handling before hwmon_device_register is called.

---
 drivers/hwmon/emc1403.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/hwmon/emc1403.c +0 -1
index 5b58b20..8dee3f3 100644
@@ -308,7 +308,6 @@ static int emc1403_probe(struct i2c_client *client,
 	res = sysfs_create_group(&client->dev.kobj, &m_thermal_gr);
 	if (res) {
 		dev_warn(&client->dev, "create group failed\n");
-		hwmon_device_unregister(data->hwmon_dev);
 		goto thermal_error1;
 	}
 	data->hwmon_dev = hwmon_device_register(&client->dev);
Signature · 7 lines
1.5.5.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Yong Wang

It is unnecessary to call hwmon_device_unregister in error handling before hwmon_device_register is called.

Not only unnecessary but wrong. Good catch.

Quoted 1 line
Quoted 24 lines
---
 drivers/hwmon/emc1403.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/hwmon/emc1403.c +0 -1
index 5b58b20..8dee3f3 100644
@@ -308,7 +308,6 @@ static int emc1403_probe(struct i2c_client *client,
 	res = sysfs_create_group(&client->dev.kobj, &m_thermal_gr);
 	if (res) {
 		dev_warn(&client->dev, "create group failed\n");
-		hwmon_device_unregister(data->hwmon_dev);
 		goto thermal_error1;
 	}
 	data->hwmon_dev = hwmon_device_register(&client->dev);
Signature · 7 lines
1.5.5.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

Applied
#2 lore raw
Quoted 9 lines · Guenter Roeck
Quoted 3 lines · Yong Wang

It is unnecessary to call hwmon_device_unregister in error handling before hwmon_device_register is called.

Not only unnecessary but wrong. Good catch.

Quoted 1 line

Applied, thanks.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors