Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315994
b: refs/heads/master
c: 5ff512b
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck committed Jul 22, 2012
1 parent 581a36b commit 465d362
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: 747e5d62ac85b9706739d2e21b1722f68d797da0
refs/heads/master: 5ff512b458ba7948d22dab0771233cf9b2da0793
15 changes: 5 additions & 10 deletions trunk/drivers/hwmon/lm87.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,11 +898,9 @@ static int lm87_probe(struct i2c_client *client, const struct i2c_device_id *id)
struct lm87_data *data;
int err;

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

i2c_set_clientdata(client, data);
data->valid = 0;
Expand All @@ -923,7 +921,7 @@ static int lm87_probe(struct i2c_client *client, const struct i2c_device_id *id)
/* Register sysfs hooks */
err = sysfs_create_group(&client->dev.kobj, &lm87_group);
if (err)
goto exit_free;
goto exit_stop;

if (data->channel & CHAN_NO_FAN(0)) {
err = sysfs_create_group(&client->dev.kobj, &lm87_group_in6);
Expand Down Expand Up @@ -972,10 +970,8 @@ static int lm87_probe(struct i2c_client *client, const struct i2c_device_id *id)

exit_remove:
lm87_remove_files(client);
exit_free:
exit_stop:
lm87_write_value(client, LM87_REG_CONFIG, data->config);
kfree(data);
exit:
return err;
}

Expand All @@ -987,7 +983,6 @@ static int lm87_remove(struct i2c_client *client)
lm87_remove_files(client);

lm87_write_value(client, LM87_REG_CONFIG, data->config);
kfree(data);
return 0;
}

Expand Down

0 comments on commit 465d362

Please sign in to comment.