Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297933
b: refs/heads/master
c: 2f3b434
h: refs/heads/master
i:
  297931: 0980a65
v: v3
  • Loading branch information
Karol Lewandowski authored and Anton Vorontsov committed Mar 26, 2012
1 parent d24374f commit 82bb70c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 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: 13e0aa469e11f31a83f32f614c1331630851af28
refs/heads/master: 2f3b43423c70a340b715396f15096c496da959bb
7 changes: 2 additions & 5 deletions trunk/drivers/power/max17042_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ static int __devinit max17042_probe(struct i2c_client *client,
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA))
return -EIO;

chip = kzalloc(sizeof(*chip), GFP_KERNEL);
chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;

Expand Down Expand Up @@ -676,10 +676,8 @@ static int __devinit max17042_probe(struct i2c_client *client,
}

ret = power_supply_register(&client->dev, &chip->battery);
if (ret) {
if (ret)
dev_err(&client->dev, "failed: power supply register\n");
kfree(chip);
}
return ret;
}

Expand All @@ -688,7 +686,6 @@ static int __devexit max17042_remove(struct i2c_client *client)
struct max17042_chip *chip = i2c_get_clientdata(client);

power_supply_unregister(&chip->battery);
kfree(chip);
return 0;
}

Expand Down

0 comments on commit 82bb70c

Please sign in to comment.