diff options
| author | Guenter Roeck <[email protected]> | 2012-06-02 18:35:53 +0000 |
|---|---|---|
| committer | Guenter Roeck <[email protected]> | 2012-07-22 04:48:42 +0000 |
| commit | 0df9fc7bb8ced5e6fc16a0141d2ee8f6f0eea61c (patch) | |
| tree | 72bb677b65f5453a715d3c5ef96019b6684bfab9 /drivers/hwmon/tmp401.c | |
| parent | hwmon: (tmp102) Convert to use devm_ functions (diff) | |
| download | kernel-0df9fc7bb8ced5e6fc16a0141d2ee8f6f0eea61c.tar.gz kernel-0df9fc7bb8ced5e6fc16a0141d2ee8f6f0eea61c.zip | |
hwmon: (tmp401) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Jean Delvare <[email protected]>
Diffstat (limited to 'drivers/hwmon/tmp401.c')
| -rw-r--r-- | drivers/hwmon/tmp401.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c index ea54c3384671..e62054875164 100644 --- a/drivers/hwmon/tmp401.c +++ b/drivers/hwmon/tmp401.c @@ -594,7 +594,6 @@ static int tmp401_remove(struct i2c_client *client) &tmp411_attr[i].dev_attr); } - kfree(data); return 0; } @@ -605,7 +604,8 @@ static int tmp401_probe(struct i2c_client *client, struct tmp401_data *data; const char *names[] = { "TMP401", "TMP411" }; - data = kzalloc(sizeof(struct tmp401_data), GFP_KERNEL); + data = devm_kzalloc(&client->dev, sizeof(struct tmp401_data), + GFP_KERNEL); if (!data) return -ENOMEM; @@ -646,7 +646,7 @@ static int tmp401_probe(struct i2c_client *client, return 0; exit_remove: - tmp401_remove(client); /* will also free data for us */ + tmp401_remove(client); return err; } |
