diff options
author | NeilBrown <neilb@suse.de> | 2012-08-01 12:40:02 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-08-01 12:40:02 +0200 |
commit | bb181e2e48f8c85db08c9cb015cbba9618dbf05c (patch) | |
tree | 191bc24dd97bcb174535cc217af082f16da3b43d /drivers/hwmon/lm93.c | |
parent | md/RAID1: Add missing case for attempting to repair known bad blocks. (diff) | |
parent | dm raid: move sectors_per_dev calculation (diff) | |
download | linux-bb181e2e48f8c85db08c9cb015cbba9618dbf05c.tar.xz linux-bb181e2e48f8c85db08c9cb015cbba9618dbf05c.zip |
Merge commit 'c039c332f23e794deb6d6f37b9f07ff3b27fb2cf' into md
Pull in pre-requisites for adding raid10 support to dm-raid.
Diffstat (limited to 'drivers/hwmon/lm93.c')
-rw-r--r-- | drivers/hwmon/lm93.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/hwmon/lm93.c b/drivers/hwmon/lm93.c index 67e8fe256e02..bf946187bd37 100644 --- a/drivers/hwmon/lm93.c +++ b/drivers/hwmon/lm93.c @@ -2738,15 +2738,13 @@ static int lm93_probe(struct i2c_client *client, } else { dev_dbg(&client->dev, "detect failed, " "smbus byte and/or word data not supported!\n"); - err = -ENODEV; - goto err_out; + return -ENODEV; } - data = kzalloc(sizeof(struct lm93_data), GFP_KERNEL); + data = devm_kzalloc(&client->dev, sizeof(struct lm93_data), GFP_KERNEL); if (!data) { dev_dbg(&client->dev, "out of memory!\n"); - err = -ENOMEM; - goto err_out; + return -ENOMEM; } i2c_set_clientdata(client, data); @@ -2760,7 +2758,7 @@ static int lm93_probe(struct i2c_client *client, err = sysfs_create_group(&client->dev.kobj, &lm93_attr_grp); if (err) - goto err_free; + return err; /* Register hwmon driver class */ data->hwmon_dev = hwmon_device_register(&client->dev); @@ -2770,9 +2768,6 @@ static int lm93_probe(struct i2c_client *client, err = PTR_ERR(data->hwmon_dev); dev_err(&client->dev, "error registering hwmon device.\n"); sysfs_remove_group(&client->dev.kobj, &lm93_attr_grp); -err_free: - kfree(data); -err_out: return err; } @@ -2783,7 +2778,6 @@ static int lm93_remove(struct i2c_client *client) hwmon_device_unregister(data->hwmon_dev); sysfs_remove_group(&client->dev.kobj, &lm93_attr_grp); - kfree(data); return 0; } |