Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315988
b: refs/heads/master
c: c5a4a91
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck committed Jul 22, 2012
1 parent 4ef889b commit 1af70b8
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: 647ff514d8a099fcce029283c1ecc38519b218d6
refs/heads/master: c5a4a91d24e0d4af8630932081a4c9a15e7fb1f7
14 changes: 4 additions & 10 deletions trunk/drivers/hwmon/lm63.c
Original file line number Diff line number Diff line change
Expand Up @@ -1108,11 +1108,9 @@ static int lm63_probe(struct i2c_client *client,
struct lm63_data *data;
int err;

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

i2c_set_clientdata(client, data);
data->valid = 0;
Expand All @@ -1129,7 +1127,7 @@ static int lm63_probe(struct i2c_client *client,
/* Register sysfs hooks */
err = sysfs_create_group(&client->dev.kobj, &lm63_group);
if (err)
goto exit_free;
return err;
if (data->config & 0x04) { /* tachometer enabled */
err = sysfs_create_group(&client->dev.kobj, &lm63_group_fan1);
if (err)
Expand Down Expand Up @@ -1161,9 +1159,6 @@ static int lm63_probe(struct i2c_client *client,
device_remove_file(&client->dev, &dev_attr_temp2_type);
sysfs_remove_group(&client->dev.kobj, &lm63_group_extra_lut);
}
exit_free:
kfree(data);
exit:
return err;
}

Expand All @@ -1179,7 +1174,6 @@ static int lm63_remove(struct i2c_client *client)
sysfs_remove_group(&client->dev.kobj, &lm63_group_extra_lut);
}

kfree(data);
return 0;
}

Expand Down

0 comments on commit 1af70b8

Please sign in to comment.