drivers/video/backlight/88pm860x_bl.c: drop devm_kfree of devm_kzalloc'd data
authorJingoo Han <jg1.han@samsung.com>
Tue, 18 Dec 2012 00:00:57 +0000 (16:00 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Dec 2012 01:15:16 +0000 (17:15 -0800)
devm_kfree() 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@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/backlight/88pm860x_bl.c

index 6e509d995093acc9efab731e582331dbfaa01013..bb21412547a9768bec755a26faab59348a2c2232 100644 (file)
@@ -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;
 }