Commit 3a1f9462 authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

drivers/video/backlight/88pm860x_bl.c: drop devm_kfree of devm_kzalloc'd data

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: default avatarJingoo Han <jg1.han@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3c48d1f2
...@@ -208,22 +208,19 @@ static int pm860x_backlight_probe(struct platform_device *pdev) ...@@ -208,22 +208,19 @@ static int pm860x_backlight_probe(struct platform_device *pdev)
res = platform_get_resource_byname(pdev, IORESOURCE_REG, "duty cycle"); res = platform_get_resource_byname(pdev, IORESOURCE_REG, "duty cycle");
if (!res) { if (!res) {
dev_err(&pdev->dev, "No REG resource for duty cycle\n"); dev_err(&pdev->dev, "No REG resource for duty cycle\n");
ret = -ENXIO; return -ENXIO;
goto out;
} }
data->reg_duty_cycle = res->start; data->reg_duty_cycle = res->start;
res = platform_get_resource_byname(pdev, IORESOURCE_REG, "always on"); res = platform_get_resource_byname(pdev, IORESOURCE_REG, "always on");
if (!res) { if (!res) {
dev_err(&pdev->dev, "No REG resorce for always on\n"); dev_err(&pdev->dev, "No REG resorce for always on\n");
ret = -ENXIO; return -ENXIO;
goto out;
} }
data->reg_always_on = res->start; data->reg_always_on = res->start;
res = platform_get_resource_byname(pdev, IORESOURCE_REG, "current"); res = platform_get_resource_byname(pdev, IORESOURCE_REG, "current");
if (!res) { if (!res) {
dev_err(&pdev->dev, "No REG resource for current\n"); dev_err(&pdev->dev, "No REG resource for current\n");
ret = -ENXIO; return -ENXIO;
goto out;
} }
data->reg_current = res->start; data->reg_current = res->start;
...@@ -263,8 +260,6 @@ static int pm860x_backlight_probe(struct platform_device *pdev) ...@@ -263,8 +260,6 @@ static int pm860x_backlight_probe(struct platform_device *pdev)
return 0; return 0;
out_brt: out_brt:
backlight_device_unregister(bl); backlight_device_unregister(bl);
out:
devm_kfree(&pdev->dev, data);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment