hwmon: (emc1403) Remove unnecessary hwmon_device_unregister
authorYong Wang <yong.y.wang@linux.intel.com>
Fri, 17 Sep 2010 15:24:12 +0000 (17:24 +0200)
committerJean Delvare <khali@linux-fr.org>
Fri, 17 Sep 2010 15:24:12 +0000 (17:24 +0200)
It is unnecessary and wrong to call hwmon_device_unregister in error
handling before hwmon_device_register is called.

Signed-off-by: Yong Wang <yong.y.wang@intel.com>
Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@kernel.org
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/emc1403.c

index 5b58b20dead1fa92b79af5c05036d45de8bf88ca..8dee3f38fdfb27e1c80a9fb36add60e414aeb805 100644 (file)
@@ -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);