Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316006
b: refs/heads/master
c: bd91d3b
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck committed Jul 22, 2012
1 parent f82a534 commit e9aee8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 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: 5d224ade31f0a08c0a0eef9e74a6187c0b8747b4
refs/heads/master: bd91d3bab8787f53c1b937ac817b0c59f8146b97
17 changes: 5 additions & 12 deletions trunk/drivers/hwmon/thmc50.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,10 @@ static int thmc50_probe(struct i2c_client *client,
struct thmc50_data *data;
int err;

data = kzalloc(sizeof(struct thmc50_data), GFP_KERNEL);
if (!data) {
pr_debug("thmc50: detect failed, kzalloc failed!\n");
err = -ENOMEM;
goto exit;
}
data = devm_kzalloc(&client->dev, sizeof(struct thmc50_data),
GFP_KERNEL);
if (!data)
return -ENOMEM;

i2c_set_clientdata(client, data);
data->type = id->driver_data;
Expand All @@ -377,7 +375,7 @@ static int thmc50_probe(struct i2c_client *client,
/* Register sysfs hooks */
err = sysfs_create_group(&client->dev.kobj, &thmc50_group);
if (err)
goto exit_free;
return err;

/* Register ADM1022 sysfs hooks */
if (data->has_temp3) {
Expand All @@ -400,9 +398,6 @@ static int thmc50_probe(struct i2c_client *client,
sysfs_remove_group(&client->dev.kobj, &temp3_group);
exit_remove_sysfs_thmc50:
sysfs_remove_group(&client->dev.kobj, &thmc50_group);
exit_free:
kfree(data);
exit:
return err;
}

Expand All @@ -415,8 +410,6 @@ static int thmc50_remove(struct i2c_client *client)
if (data->has_temp3)
sysfs_remove_group(&client->dev.kobj, &temp3_group);

kfree(data);

return 0;
}

Expand Down

0 comments on commit e9aee8c

Please sign in to comment.