drivers/video/backlight/max8925_bl.c: drop devm_kfree of devm_kzalloc'd data
authorJingoo Han <jg1.han@samsung.com>
Tue, 18 Dec 2012 00:00:58 +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/max8925_bl.c

index c6bec7aab87b74c408f25adf5addbabea94c9a6a..2c9bce050aa954a03bd04ee09b5be4d45fe9a3a4 100644 (file)
@@ -120,15 +120,13 @@ static int max8925_backlight_probe(struct platform_device *pdev)
        res = platform_get_resource(pdev, IORESOURCE_REG, 0);
        if (!res) {
                dev_err(&pdev->dev, "No REG resource for mode control!\n");
-               ret = -ENXIO;
-               goto out;
+               return -ENXIO;
        }
        data->reg_mode_cntl = res->start;
        res = platform_get_resource(pdev, IORESOURCE_REG, 1);
        if (!res) {
                dev_err(&pdev->dev, "No REG resource for control!\n");
-               ret = -ENXIO;
-               goto out;
+               return -ENXIO;
        }
        data->reg_cntl = res->start;
 
@@ -142,8 +140,7 @@ static int max8925_backlight_probe(struct platform_device *pdev)
                                        &max8925_backlight_ops, &props);
        if (IS_ERR(bl)) {
                dev_err(&pdev->dev, "failed to register backlight\n");
-               ret = PTR_ERR(bl);
-               goto out;
+               return PTR_ERR(bl);
        }
        bl->props.brightness = MAX_BRIGHTNESS;
 
@@ -166,8 +163,6 @@ static int max8925_backlight_probe(struct platform_device *pdev)
        return 0;
 out_brt:
        backlight_device_unregister(bl);
-out:
-       devm_kfree(&pdev->dev, data);
        return ret;
 }