aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/lm85.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c
index 94a10ecd24df..3ff0285396fa 100644
--- a/drivers/hwmon/lm85.c
+++ b/drivers/hwmon/lm85.c
@@ -1244,7 +1244,7 @@ static int lm85_probe(struct i2c_client *client,
1244 /* Register sysfs hooks */ 1244 /* Register sysfs hooks */
1245 err = sysfs_create_group(&client->dev.kobj, &lm85_group); 1245 err = sysfs_create_group(&client->dev.kobj, &lm85_group);
1246 if (err) 1246 if (err)
1247 goto ERROR1; 1247 goto err_kfree;
1248 1248
1249 /* The ADT7463 has an optional VRM 10 mode where pin 21 is used 1249 /* The ADT7463 has an optional VRM 10 mode where pin 21 is used
1250 as a sixth digital VID input rather than an analog input. */ 1250 as a sixth digital VID input rather than an analog input. */
@@ -1252,29 +1252,29 @@ static int lm85_probe(struct i2c_client *client,
1252 if (!(data->type == adt7463 && (data->vid & 0x80))) 1252 if (!(data->type == adt7463 && (data->vid & 0x80)))
1253 if ((err = sysfs_create_group(&client->dev.kobj, 1253 if ((err = sysfs_create_group(&client->dev.kobj,
1254 &lm85_group_in4))) 1254 &lm85_group_in4)))
1255 goto ERROR3; 1255 goto err_remove_files;
1256 1256
1257 /* The EMC6D100 has 3 additional voltage inputs */ 1257 /* The EMC6D100 has 3 additional voltage inputs */
1258 if (data->type == emc6d100) 1258 if (data->type == emc6d100)
1259 if ((err = sysfs_create_group(&client->dev.kobj, 1259 if ((err = sysfs_create_group(&client->dev.kobj,
1260 &lm85_group_in567))) 1260 &lm85_group_in567)))
1261 goto ERROR3; 1261 goto err_remove_files;
1262 1262
1263 data->hwmon_dev = hwmon_device_register(&client->dev); 1263 data->hwmon_dev = hwmon_device_register(&client->dev);
1264 if (IS_ERR(data->hwmon_dev)) { 1264 if (IS_ERR(data->hwmon_dev)) {
1265 err = PTR_ERR(data->hwmon_dev); 1265 err = PTR_ERR(data->hwmon_dev);
1266 goto ERROR3; 1266 goto err_remove_files;
1267 } 1267 }
1268 1268
1269 return 0; 1269 return 0;
1270 1270
1271 /* Error out and cleanup code */ 1271 /* Error out and cleanup code */
1272 ERROR3: 1272 err_remove_files:
1273 sysfs_remove_group(&client->dev.kobj, &lm85_group); 1273 sysfs_remove_group(&client->dev.kobj, &lm85_group);
1274 sysfs_remove_group(&client->dev.kobj, &lm85_group_in4); 1274 sysfs_remove_group(&client->dev.kobj, &lm85_group_in4);
1275 if (data->type == emc6d100) 1275 if (data->type == emc6d100)
1276 sysfs_remove_group(&client->dev.kobj, &lm85_group_in567); 1276 sysfs_remove_group(&client->dev.kobj, &lm85_group_in567);
1277 ERROR1: 1277 err_kfree:
1278 kfree(data); 1278 kfree(data);
1279 return err; 1279 return err;
1280} 1280}