diff options
Diffstat (limited to 'drivers/hwmon/adt7475.c')
-rw-r--r-- | drivers/hwmon/adt7475.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c index df29d13a5349..861c756e9536 100644 --- a/drivers/hwmon/adt7475.c +++ b/drivers/hwmon/adt7475.c | |||
@@ -1260,7 +1260,7 @@ static int adt7475_probe(struct i2c_client *client, | |||
1260 | int i, ret = 0, revision; | 1260 | int i, ret = 0, revision; |
1261 | u8 config2, config3; | 1261 | u8 config2, config3; |
1262 | 1262 | ||
1263 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 1263 | data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL); |
1264 | if (data == NULL) | 1264 | if (data == NULL) |
1265 | return -ENOMEM; | 1265 | return -ENOMEM; |
1266 | 1266 | ||
@@ -1344,7 +1344,7 @@ static int adt7475_probe(struct i2c_client *client, | |||
1344 | 1344 | ||
1345 | ret = sysfs_create_group(&client->dev.kobj, &adt7475_attr_group); | 1345 | ret = sysfs_create_group(&client->dev.kobj, &adt7475_attr_group); |
1346 | if (ret) | 1346 | if (ret) |
1347 | goto efree; | 1347 | return ret; |
1348 | 1348 | ||
1349 | /* Features that can be disabled individually */ | 1349 | /* Features that can be disabled individually */ |
1350 | if (data->has_fan4) { | 1350 | if (data->has_fan4) { |
@@ -1410,8 +1410,6 @@ static int adt7475_probe(struct i2c_client *client, | |||
1410 | 1410 | ||
1411 | eremove: | 1411 | eremove: |
1412 | adt7475_remove_files(client, data); | 1412 | adt7475_remove_files(client, data); |
1413 | efree: | ||
1414 | kfree(data); | ||
1415 | return ret; | 1413 | return ret; |
1416 | } | 1414 | } |
1417 | 1415 | ||
@@ -1421,7 +1419,6 @@ static int adt7475_remove(struct i2c_client *client) | |||
1421 | 1419 | ||
1422 | hwmon_device_unregister(data->hwmon_dev); | 1420 | hwmon_device_unregister(data->hwmon_dev); |
1423 | adt7475_remove_files(client, data); | 1421 | adt7475_remove_files(client, data); |
1424 | kfree(data); | ||
1425 | 1422 | ||
1426 | return 0; | 1423 | return 0; |
1427 | } | 1424 | } |