* [PATCH] regulator: da9052: Remove unneeded devm_kfree calls
@ 2012-04-05 4:08 Axel Lin
2012-04-05 10:06 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-04-05 4:08 UTC (permalink / raw)
To: linux-kernel
Cc: David Dajun Chen, Ashish Jangam, Ying-Chun Liu (PaulLiu),
Mark Brown, Liam Girdwood
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/da9052-regulator.c | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c
index 7eb7293..83e489f 100644
--- a/drivers/regulator/da9052-regulator.c
+++ b/drivers/regulator/da9052-regulator.c
@@ -406,7 +406,6 @@ static int __devinit da9052_regulator_probe(struct platform_device *pdev)
struct da9052_regulator *regulator;
struct da9052 *da9052;
struct da9052_pdata *pdata;
- int ret;
regulator = devm_kzalloc(&pdev->dev, sizeof(struct da9052_regulator),
GFP_KERNEL);
@@ -421,8 +420,7 @@ static int __devinit da9052_regulator_probe(struct platform_device *pdev)
pdev->id);
if (regulator->info == NULL) {
dev_err(&pdev->dev, "invalid regulator ID specified\n");
- ret = -EINVAL;
- goto err;
+ return -EINVAL;
}
regulator->rdev = regulator_register(®ulator->info->reg_desc,
&pdev->dev,
@@ -431,16 +429,12 @@ static int __devinit da9052_regulator_probe(struct platform_device *pdev)
if (IS_ERR(regulator->rdev)) {
dev_err(&pdev->dev, "failed to register regulator %s\n",
regulator->info->reg_desc.name);
- ret = PTR_ERR(regulator->rdev);
- goto err;
+ return PTR_ERR(regulator->rdev);
}
platform_set_drvdata(pdev, regulator);
return 0;
-err:
- devm_kfree(&pdev->dev, regulator);
- return ret;
}
static int __devexit da9052_regulator_remove(struct platform_device *pdev)
@@ -448,8 +442,6 @@ static int __devexit da9052_regulator_remove(struct platform_device *pdev)
struct da9052_regulator *regulator = platform_get_drvdata(pdev);
regulator_unregister(regulator->rdev);
- devm_kfree(&pdev->dev, regulator);
-
return 0;
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] regulator: da9052: Remove unneeded devm_kfree calls
2012-04-05 4:08 [PATCH] regulator: da9052: Remove unneeded devm_kfree calls Axel Lin
@ 2012-04-05 10:06 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-04-05 10:06 UTC (permalink / raw)
To: Axel Lin
Cc: linux-kernel, David Dajun Chen, Ashish Jangam,
Ying-Chun Liu (PaulLiu), Liam Girdwood
[-- Attachment #1: Type: text/plain, Size: 123 bytes --]
On Thu, Apr 05, 2012 at 12:08:58PM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-05 10:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-05 4:08 [PATCH] regulator: da9052: Remove unneeded devm_kfree calls Axel Lin
2012-04-05 10:06 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox