diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-08-20 21:26:04 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-08-20 21:26:04 +0200 |
commit | f0b433e9f362e0b7f0ce7d1489dd7feba068605d (patch) | |
tree | d4bfd9489cf4a96a55d83af20919f477a846d585 /drivers/hwmon/lm80.c | |
parent | fa2f5bf09610d3c216d4c74855edbe00d636467c (diff) | |
parent | 28c42c28309244d0b15d1b385e33429d59997679 (diff) |
Merge tag 'asoc-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Additional updates for 3.6
A batch more bugfixes, all driver-specific and fairly small and
unremarkable in a global context. The biggest batch are for the newly
added Arizona drivers.
Diffstat (limited to 'drivers/hwmon/lm80.c')
-rw-r--r-- | drivers/hwmon/lm80.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/hwmon/lm80.c b/drivers/hwmon/lm80.c index e2c43e1774b..28a8b71f457 100644 --- a/drivers/hwmon/lm80.c +++ b/drivers/hwmon/lm80.c @@ -543,11 +543,9 @@ static int lm80_probe(struct i2c_client *client, struct lm80_data *data; int err; - data = kzalloc(sizeof(struct lm80_data), GFP_KERNEL); - if (!data) { - err = -ENOMEM; - goto exit; - } + data = devm_kzalloc(&client->dev, sizeof(struct lm80_data), GFP_KERNEL); + if (!data) + return -ENOMEM; i2c_set_clientdata(client, data); mutex_init(&data->update_lock); @@ -562,7 +560,7 @@ static int lm80_probe(struct i2c_client *client, /* Register sysfs hooks */ err = sysfs_create_group(&client->dev.kobj, &lm80_group); if (err) - goto error_free; + return err; data->hwmon_dev = hwmon_device_register(&client->dev); if (IS_ERR(data->hwmon_dev)) { @@ -574,9 +572,6 @@ static int lm80_probe(struct i2c_client *client, error_remove: sysfs_remove_group(&client->dev.kobj, &lm80_group); -error_free: - kfree(data); -exit: return err; } @@ -587,7 +582,6 @@ static int lm80_remove(struct i2c_client *client) hwmon_device_unregister(data->hwmon_dev); sysfs_remove_group(&client->dev.kobj, &lm80_group); - kfree(data); return 0; } |