Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315991
b: refs/heads/master
c: 52714c0
h: refs/heads/master
i:
  315989: d59b5b6
  315987: 4ef889b
  315983: 8a7f146
v: v3
  • Loading branch information
Guenter Roeck committed Jul 22, 2012
1 parent 9f56866 commit b5ce633
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: efd2d117aeb5f01cc9c90e56fff29d4a5f535580
refs/heads/master: 52714c04df4b12ca308a1d792d50681df43365c2
14 changes: 4 additions & 10 deletions trunk/drivers/hwmon/lm77.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,9 @@ static int lm77_probe(struct i2c_client *client, const struct i2c_device_id *id)
struct lm77_data *data;
int err;

data = kzalloc(sizeof(struct lm77_data), GFP_KERNEL);
if (!data) {
err = -ENOMEM;
goto exit;
}
data = devm_kzalloc(dev, sizeof(struct lm77_data), GFP_KERNEL);
if (!data)
return -ENOMEM;

i2c_set_clientdata(client, data);
data->valid = 0;
Expand All @@ -359,7 +357,7 @@ static int lm77_probe(struct i2c_client *client, const struct i2c_device_id *id)
/* Register sysfs hooks */
err = sysfs_create_group(&dev->kobj, &lm77_group);
if (err)
goto exit_free;
return err;

data->hwmon_dev = hwmon_device_register(dev);
if (IS_ERR(data->hwmon_dev)) {
Expand All @@ -371,9 +369,6 @@ static int lm77_probe(struct i2c_client *client, const struct i2c_device_id *id)

exit_remove:
sysfs_remove_group(&dev->kobj, &lm77_group);
exit_free:
kfree(data);
exit:
return err;
}

Expand All @@ -382,7 +377,6 @@ static int lm77_remove(struct i2c_client *client)
struct lm77_data *data = i2c_get_clientdata(client);
hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &lm77_group);
kfree(data);
return 0;
}

Expand Down

0 comments on commit b5ce633

Please sign in to comment.