Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302319
b: refs/heads/master
c: 68d8c1c
h: refs/heads/master
i:
  302317: 3fbac7a
  302315: 6de81ad
  302311: 144f6da
  302303: b7e9496
v: v3
  • Loading branch information
Laxman Dewangan authored and Mark Brown committed May 19, 2012
1 parent 5c2a91c commit 9974518
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 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: 33a6943d2c7fb7567148cc80f016d0f65e3caf36
refs/heads/master: 68d8c1cd5158e1452c454dadbc64b3955e88e98b
27 changes: 9 additions & 18 deletions trunk/drivers/regulator/tps65910-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1183,25 +1183,25 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
return -ENODEV;
}

pmic->desc = kcalloc(pmic->num_regulators,
pmic->desc = devm_kzalloc(&pdev->dev, pmic->num_regulators *
sizeof(struct regulator_desc), GFP_KERNEL);
if (!pmic->desc) {
err = -ENOMEM;
goto err_out;
dev_err(&pdev->dev, "Memory alloc fails for desc\n");
return -ENOMEM;
}

pmic->info = kcalloc(pmic->num_regulators,
pmic->info = devm_kzalloc(&pdev->dev, pmic->num_regulators *
sizeof(struct tps_info *), GFP_KERNEL);
if (!pmic->info) {
err = -ENOMEM;
goto err_free_desc;
dev_err(&pdev->dev, "Memory alloc fails for info\n");
return -ENOMEM;
}

pmic->rdev = kcalloc(pmic->num_regulators,
pmic->rdev = devm_kzalloc(&pdev->dev, pmic->num_regulators *
sizeof(struct regulator_dev *), GFP_KERNEL);
if (!pmic->rdev) {
err = -ENOMEM;
goto err_free_info;
dev_err(&pdev->dev, "Memory alloc fails for rdev\n");
return -ENOMEM;
}

for (i = 0; i < pmic->num_regulators && i < TPS65910_NUM_REGS;
Expand Down Expand Up @@ -1279,12 +1279,6 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
err_unregister_regulator:
while (--i >= 0)
regulator_unregister(pmic->rdev[i]);
kfree(pmic->rdev);
err_free_info:
kfree(pmic->info);
err_free_desc:
kfree(pmic->desc);
err_out:
return err;
}

Expand All @@ -1296,9 +1290,6 @@ static int __devexit tps65910_remove(struct platform_device *pdev)
for (i = 0; i < pmic->num_regulators; i++)
regulator_unregister(pmic->rdev[i]);

kfree(pmic->rdev);
kfree(pmic->info);
kfree(pmic->desc);
return 0;
}

Expand Down

0 comments on commit 9974518

Please sign in to comment.