Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315992
b: refs/heads/master
c: c38b282
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck committed Jul 22, 2012
1 parent b5ce633 commit 4deebcd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52714c04df4b12ca308a1d792d50681df43365c2
refs/heads/master: c38b2820cb4014b86b0bf45f334d3436c03b14be
14 changes: 4 additions & 10 deletions trunk/drivers/hwmon/lm80.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)) {
Expand All @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 4deebcd

Please sign in to comment.