From 08d7563b268962fa7bcbe818accce4b2bfa914bb Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Fri, 9 Nov 2012 14:04:48 +1100 Subject: [PATCH] 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: Jingoo Han Cc: Richard Purdie Signed-off-by: Andrew Morton --- drivers/video/backlight/88pm860x_bl.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c index 6e509d995093..bb21412547a9 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; } -- 2.39.5