Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316001
b: refs/heads/master
c: 60c2b56
h: refs/heads/master
i:
  315999: ed14daf
v: v3
  • Loading branch information
Guenter Roeck committed Jul 22, 2012
1 parent 427c10b commit d1ec545
Show file tree
Hide file tree
Showing 2 changed files with 6 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: 96f316c24c0aea2984c90170966d9a2cb93d1094
refs/heads/master: 60c2b5697560b0216ddbebaabebd1aac7abe3012
15 changes: 5 additions & 10 deletions trunk/drivers/hwmon/pcf8591.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,10 @@ static int pcf8591_probe(struct i2c_client *client,
struct pcf8591_data *data;
int err;

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

i2c_set_clientdata(client, data);
mutex_init(&data->update_lock);
Expand All @@ -215,7 +214,7 @@ static int pcf8591_probe(struct i2c_client *client,
/* Register sysfs hooks */
err = sysfs_create_group(&client->dev.kobj, &pcf8591_attr_group);
if (err)
goto exit_kfree;
return err;

/* Register input2 if not in "two differential inputs" mode */
if (input_mode != 3) {
Expand All @@ -242,9 +241,6 @@ static int pcf8591_probe(struct i2c_client *client,
exit_sysfs_remove:
sysfs_remove_group(&client->dev.kobj, &pcf8591_attr_group_opt);
sysfs_remove_group(&client->dev.kobj, &pcf8591_attr_group);
exit_kfree:
kfree(data);
exit:
return err;
}

Expand All @@ -255,7 +251,6 @@ static int pcf8591_remove(struct i2c_client *client)
hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &pcf8591_attr_group_opt);
sysfs_remove_group(&client->dev.kobj, &pcf8591_attr_group);
kfree(i2c_get_clientdata(client));
return 0;
}

Expand Down

0 comments on commit d1ec545

Please sign in to comment.