diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-09-05 09:57:19 +0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-09-05 09:57:19 +0400 |
commit | e6c340171f0daaccc95b90abbeed2b837157ee11 (patch) | |
tree | 843d4035be59bd791321910e52157ce527b3b4b3 /drivers/hwmon/gl518sm.c | |
parent | a85442ade272121927a56e02f7dfde1127482df2 (diff) | |
parent | 4cbe5a555fa58a79b6ecbb6c531b8bab0650778d (diff) | |
download | linux-e6c340171f0daaccc95b90abbeed2b837157ee11.tar.xz |
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/gl518sm.c')
-rw-r--r-- | drivers/hwmon/gl518sm.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/hwmon/gl518sm.c b/drivers/hwmon/gl518sm.c index 764a083ac7a7..2c74673f48e5 100644 --- a/drivers/hwmon/gl518sm.c +++ b/drivers/hwmon/gl518sm.c @@ -544,11 +544,10 @@ static int gl518_probe(struct i2c_client *client, struct gl518_data *data; int err, revision; - data = kzalloc(sizeof(struct gl518_data), GFP_KERNEL); - if (!data) { - err = -ENOMEM; - goto exit; - } + data = devm_kzalloc(&client->dev, sizeof(struct gl518_data), + GFP_KERNEL); + if (!data) + return -ENOMEM; i2c_set_clientdata(client, data); revision = gl518_read_value(client, GL518_REG_REVISION); @@ -562,7 +561,7 @@ static int gl518_probe(struct i2c_client *client, /* Register sysfs hooks */ err = sysfs_create_group(&client->dev.kobj, &gl518_group); if (err) - goto exit_free; + return err; if (data->type == gl518sm_r80) { err = sysfs_create_group(&client->dev.kobj, &gl518_group_r80); if (err) @@ -581,9 +580,6 @@ exit_remove_files: sysfs_remove_group(&client->dev.kobj, &gl518_group); if (data->type == gl518sm_r80) sysfs_remove_group(&client->dev.kobj, &gl518_group_r80); -exit_free: - kfree(data); -exit: return err; } @@ -617,7 +613,6 @@ static int gl518_remove(struct i2c_client *client) if (data->type == gl518sm_r80) sysfs_remove_group(&client->dev.kobj, &gl518_group_r80); - kfree(data); return 0; } |