Commit 2c114cb4 authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

drivers/video/backlight/max8925_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 3a1f9462
...@@ -120,15 +120,13 @@ static int max8925_backlight_probe(struct platform_device *pdev) ...@@ -120,15 +120,13 @@ static int max8925_backlight_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_REG, 0); res = platform_get_resource(pdev, IORESOURCE_REG, 0);
if (!res) { if (!res) {
dev_err(&pdev->dev, "No REG resource for mode control!\n"); dev_err(&pdev->dev, "No REG resource for mode control!\n");
ret = -ENXIO; return -ENXIO;
goto out;
} }
data->reg_mode_cntl = res->start; data->reg_mode_cntl = res->start;
res = platform_get_resource(pdev, IORESOURCE_REG, 1); res = platform_get_resource(pdev, IORESOURCE_REG, 1);
if (!res) { if (!res) {
dev_err(&pdev->dev, "No REG resource for control!\n"); dev_err(&pdev->dev, "No REG resource for control!\n");
ret = -ENXIO; return -ENXIO;
goto out;
} }
data->reg_cntl = res->start; data->reg_cntl = res->start;
...@@ -142,8 +140,7 @@ static int max8925_backlight_probe(struct platform_device *pdev) ...@@ -142,8 +140,7 @@ static int max8925_backlight_probe(struct platform_device *pdev)
&max8925_backlight_ops, &props); &max8925_backlight_ops, &props);
if (IS_ERR(bl)) { if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n"); dev_err(&pdev->dev, "failed to register backlight\n");
ret = PTR_ERR(bl); return PTR_ERR(bl);
goto out;
} }
bl->props.brightness = MAX_BRIGHTNESS; bl->props.brightness = MAX_BRIGHTNESS;
...@@ -166,8 +163,6 @@ static int max8925_backlight_probe(struct platform_device *pdev) ...@@ -166,8 +163,6 @@ static int max8925_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