Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350597
b: refs/heads/master
c: a9672e1
h: refs/heads/master
i:
  350595: 36de686
v: v3
  • Loading branch information
Sachin Kamat authored and Anton Vorontsov committed Jan 6, 2013
1 parent ef9951e commit 6710407
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 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: 463df5147edb2d8e3df1300b02c192a5642e72c4
refs/heads/master: a9672e1356471b0a1d63a303cc1dfc53b739efb9
15 changes: 6 additions & 9 deletions trunk/drivers/power/bq2415x_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,7 @@ static int bq2415x_probe(struct i2c_client *client,
goto error_1;
}

bq = kzalloc(sizeof(*bq), GFP_KERNEL);
bq = devm_kzalloc(&client->dev, sizeof(*bq), GFP_KERNEL);
if (!bq) {
dev_err(&client->dev, "failed to allocate device data\n");
ret = -ENOMEM;
Expand All @@ -1548,19 +1548,19 @@ static int bq2415x_probe(struct i2c_client *client,
ret = bq2415x_power_supply_init(bq);
if (ret) {
dev_err(bq->dev, "failed to register power supply: %d\n", ret);
goto error_3;
goto error_2;
}

ret = bq2415x_sysfs_init(bq);
if (ret) {
dev_err(bq->dev, "failed to create sysfs entries: %d\n", ret);
goto error_4;
goto error_3;
}

ret = bq2415x_set_defaults(bq);
if (ret) {
dev_err(bq->dev, "failed to set default values: %d\n", ret);
goto error_5;
goto error_4;
}

if (bq->init_data.set_mode_hook) {
Expand All @@ -1584,12 +1584,10 @@ static int bq2415x_probe(struct i2c_client *client,
dev_info(bq->dev, "driver registered\n");
return 0;

error_5:
bq2415x_sysfs_exit(bq);
error_4:
bq2415x_power_supply_exit(bq);
bq2415x_sysfs_exit(bq);
error_3:
kfree(bq);
bq2415x_power_supply_exit(bq);
error_2:
kfree(name);
error_1:
Expand Down Expand Up @@ -1621,7 +1619,6 @@ static int bq2415x_remove(struct i2c_client *client)
dev_info(bq->dev, "driver unregistered\n");

kfree(bq->name);
kfree(bq);

return 0;
}
Expand Down

0 comments on commit 6710407

Please sign in to comment.