Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302197
b: refs/heads/master
c: 9eb0c42
h: refs/heads/master
i:
  302195: f494a9f
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 11, 2012
1 parent fddcfbf commit 96d91c1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 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: d914d81b74fd4e91aed334c3f664be4b94364ee8
refs/heads/master: 9eb0c4218aa444f863e7f54909351d5b4f0fac06
7 changes: 1 addition & 6 deletions trunk/drivers/regulator/tps6507x-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static __devinit int tps6507x_pmic_probe(struct platform_device *pdev)
if (!init_data)
return -EINVAL;

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

Expand Down Expand Up @@ -479,8 +479,6 @@ static __devinit int tps6507x_pmic_probe(struct platform_device *pdev)
fail:
while (--i >= 0)
regulator_unregister(tps->rdev[i]);

kfree(tps);
return error;
}

Expand All @@ -492,9 +490,6 @@ static int __devexit tps6507x_pmic_remove(struct platform_device *pdev)

for (i = 0; i < TPS6507X_NUM_REGULATOR; i++)
regulator_unregister(tps->rdev[i]);

kfree(tps);

return 0;
}

Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/regulator/tps6524x-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ static int pmic_remove(struct spi_device *spi)
hw->rdev[i] = NULL;
}
spi_set_drvdata(spi, NULL);
kfree(hw);
return 0;
}

Expand All @@ -614,7 +613,7 @@ static int __devinit pmic_probe(struct spi_device *spi)
return -EINVAL;
}

hw = kzalloc(sizeof(struct tps6524x), GFP_KERNEL);
hw = devm_kzalloc(&spi->dev, sizeof(struct tps6524x), GFP_KERNEL);
if (!hw) {
dev_err(dev, "cannot allocate regulator private data\n");
return -ENOMEM;
Expand Down
9 changes: 3 additions & 6 deletions trunk/drivers/regulator/tps65910-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
if (!pmic_plat_data)
return -EINVAL;

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

Expand All @@ -1136,15 +1136,14 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
break;
default:
pr_err("Invalid tps chip version\n");
kfree(pmic);
return -ENODEV;
}

pmic->desc = kcalloc(pmic->num_regulators,
sizeof(struct regulator_desc), GFP_KERNEL);
if (!pmic->desc) {
err = -ENOMEM;
goto err_free_pmic;
goto err_out;
}

pmic->info = kcalloc(pmic->num_regulators,
Expand Down Expand Up @@ -1233,8 +1232,7 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
kfree(pmic->info);
err_free_desc:
kfree(pmic->desc);
err_free_pmic:
kfree(pmic);
err_out:
return err;
}

Expand All @@ -1249,7 +1247,6 @@ static int __devexit tps65910_remove(struct platform_device *pdev)
kfree(pmic->rdev);
kfree(pmic->info);
kfree(pmic->desc);
kfree(pmic);
return 0;
}

Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/regulator/tps65912-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ static __devinit int tps65912_probe(struct platform_device *pdev)

reg_data = pmic_plat_data->tps65912_pmic_init_data;

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

Expand Down Expand Up @@ -523,8 +523,6 @@ static __devinit int tps65912_probe(struct platform_device *pdev)
err:
while (--i >= 0)
regulator_unregister(pmic->rdev[i]);

kfree(pmic);
return err;
}

Expand All @@ -535,8 +533,6 @@ static int __devexit tps65912_remove(struct platform_device *pdev)

for (i = 0; i < TPS65912_NUM_REGULATOR; i++)
regulator_unregister(tps65912_reg->rdev[i]);

kfree(tps65912_reg);
return 0;
}

Expand Down

0 comments on commit 96d91c1

Please sign in to comment.