[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <000501cdb590$588260f0$098722d0$%han@samsung.com>
Date: Mon, 29 Oct 2012 13:46:22 +0900
From: Jingoo Han <jg1.han@...sung.com>
To: 'Andrew Morton' <akpm@...ux-foundation.org>,
'LKML' <linux-kernel@...r.kernel.org>
Cc: 'Richard Purdie' <rpurdie@...ys.net>,
'Jingoo Han' <jg1.han@...sung.com>
Subject: [PATCH 1/2] backlight: 88pm860x: drop devm_kfree of devm_kzalloc'd data
The devm_kfree function allocates memory that is released
when a driver detaches. Thus, there is no reason to explicitly
call devm_kfree in probe or remove functions.
Signed-off-by: Jingoo Han <jg1.han@...sung.com>
Cc: Richard Purdie <rpurdie@...ys.net>
---
drivers/video/backlight/88pm860x_bl.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c
index b7ec34c..861cc40 100644
--- a/drivers/video/backlight/88pm860x_bl.c
+++ b/drivers/video/backlight/88pm860x_bl.c
@@ -208,22 +208,19 @@ static int pm860x_backlight_probe(struct platform_device *pdev)
res = platform_get_resource_byname(pdev, IORESOURCE_REG, "duty cycle");
if (!res) {
dev_err(&pdev->dev, "No REG resource for duty cycle\n");
- ret = -ENXIO;
- goto out;
+ return -ENXIO;
}
data->reg_duty_cycle = res->start;
res = platform_get_resource_byname(pdev, IORESOURCE_REG, "always on");
if (!res) {
dev_err(&pdev->dev, "No REG resorce for always on\n");
- ret = -ENXIO;
- goto out;
+ return -ENXIO;
}
data->reg_always_on = res->start;
res = platform_get_resource_byname(pdev, IORESOURCE_REG, "current");
if (!res) {
dev_err(&pdev->dev, "No REG resource for current\n");
- ret = -ENXIO;
- goto out;
+ return -ENXIO;
}
data->reg_current = res->start;
@@ -263,8 +260,6 @@ static int pm860x_backlight_probe(struct platform_device *pdev)
return 0;
out_brt:
backlight_device_unregister(bl);
-out:
- devm_kfree(&pdev->dev, data);
return ret;
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists