Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315984
b: refs/heads/master
c: e20b4b3
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck committed Jul 22, 2012
1 parent 8a7f146 commit 6961521
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 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: d466a353052582ea784d9f5352c822d828d00244
refs/heads/master: e20b4b38cdf1622d1577ae5e402ded2bd63bf616
16 changes: 5 additions & 11 deletions trunk/drivers/hwmon/ds1621.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,10 @@ static int ds1621_probe(struct i2c_client *client,
struct ds1621_data *data;
int err;

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

i2c_set_clientdata(client, data);
mutex_init(&data->update_lock);
Expand All @@ -264,7 +263,7 @@ static int ds1621_probe(struct i2c_client *client,
/* Register sysfs hooks */
err = sysfs_create_group(&client->dev.kobj, &ds1621_group);
if (err)
goto exit_free;
return err;

data->hwmon_dev = hwmon_device_register(&client->dev);
if (IS_ERR(data->hwmon_dev)) {
Expand All @@ -276,9 +275,6 @@ static int ds1621_probe(struct i2c_client *client,

exit_remove_files:
sysfs_remove_group(&client->dev.kobj, &ds1621_group);
exit_free:
kfree(data);
exit:
return err;
}

Expand All @@ -289,8 +285,6 @@ static int ds1621_remove(struct i2c_client *client)
hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &ds1621_group);

kfree(data);

return 0;
}

Expand Down

0 comments on commit 6961521

Please sign in to comment.