diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-09-05 07:57:19 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-09-05 07:57:19 +0200 |
commit | e6c340171f0daaccc95b90abbeed2b837157ee11 (patch) | |
tree | 843d4035be59bd791321910e52157ce527b3b4b3 /drivers/hwmon/adm1031.c | |
parent | Input: tegra - move platform data header (diff) | |
parent | Linux 3.6-rc4 (diff) | |
download | linux-e6c340171f0daaccc95b90abbeed2b837157ee11.tar.xz linux-e6c340171f0daaccc95b90abbeed2b837157ee11.zip |
Merge tag 'v3.6-rc4' into next
Linux 3.6-rc4
# gpg: Signature made Sat 01 Sep 2012 10:40:33 AM PDT using RSA key ID 00411886
# gpg: Good signature from "Linus Torvalds <torvalds@linux-foundation.org>"
Diffstat (limited to 'drivers/hwmon/adm1031.c')
-rw-r--r-- | drivers/hwmon/adm1031.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c index 44e1fd7f3d81..c6a4631e833f 100644 --- a/drivers/hwmon/adm1031.c +++ b/drivers/hwmon/adm1031.c @@ -954,11 +954,10 @@ static int adm1031_probe(struct i2c_client *client, struct adm1031_data *data; int err; - data = kzalloc(sizeof(struct adm1031_data), GFP_KERNEL); - if (!data) { - err = -ENOMEM; - goto exit; - } + data = devm_kzalloc(&client->dev, sizeof(struct adm1031_data), + GFP_KERNEL); + if (!data) + return -ENOMEM; i2c_set_clientdata(client, data); data->chip_type = id->driver_data; @@ -975,7 +974,7 @@ static int adm1031_probe(struct i2c_client *client, /* Register sysfs hooks */ err = sysfs_create_group(&client->dev.kobj, &adm1031_group); if (err) - goto exit_free; + return err; if (data->chip_type == adm1031) { err = sysfs_create_group(&client->dev.kobj, &adm1031_group_opt); @@ -994,9 +993,6 @@ static int adm1031_probe(struct i2c_client *client, exit_remove: sysfs_remove_group(&client->dev.kobj, &adm1031_group); sysfs_remove_group(&client->dev.kobj, &adm1031_group_opt); -exit_free: - kfree(data); -exit: return err; } @@ -1007,7 +1003,6 @@ static int adm1031_remove(struct i2c_client *client) hwmon_device_unregister(data->hwmon_dev); sysfs_remove_group(&client->dev.kobj, &adm1031_group); sysfs_remove_group(&client->dev.kobj, &adm1031_group_opt); - kfree(data); return 0; } |