diff options
author | Guenter Roeck <linux@roeck-us.net> | 2012-06-02 09:58:01 -0700 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2012-07-21 21:48:38 -0700 |
commit | e3ecb2eeedfc7b2c6b9f0d2db194eb43f34b688f (patch) | |
tree | f63ae2db365793af221cac92778a347efb06522d /drivers/hwmon/adt7475.c | |
parent | 6702c9981e92aeb5cbfc192d23c11ef0f26b6157 (diff) | |
download | linux-e3ecb2eeedfc7b2c6b9f0d2db194eb43f34b688f.tar.bz2 |
hwmon: (adt7475) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
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, int i, ret = 0, revision; u8 config2, config3; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL); if (data == NULL) return -ENOMEM; @@ -1344,7 +1344,7 @@ static int adt7475_probe(struct i2c_client *client, ret = sysfs_create_group(&client->dev.kobj, &adt7475_attr_group); if (ret) - goto efree; + return ret; /* Features that can be disabled individually */ if (data->has_fan4) { @@ -1410,8 +1410,6 @@ static int adt7475_probe(struct i2c_client *client, eremove: adt7475_remove_files(client, data); -efree: - kfree(data); return ret; } @@ -1421,7 +1419,6 @@ static int adt7475_remove(struct i2c_client *client) hwmon_device_unregister(data->hwmon_dev); adt7475_remove_files(client, data); - kfree(data); return 0; } |