Commit 3651c4b9 authored by Jingoo Han's avatar Jingoo Han Committed by Bryan Wu

leds: leds-88pm860x: drop devm_kfree of devm_kzalloc'd data

The devm_kfree function 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>
Signed-off-by: default avatarBryan Wu <cooloney@gmail.com>
parent 1b21ec5a
...@@ -165,15 +165,13 @@ static int pm860x_led_probe(struct platform_device *pdev) ...@@ -165,15 +165,13 @@ static int pm860x_led_probe(struct platform_device *pdev)
res = platform_get_resource_byname(pdev, IORESOURCE_REG, "control"); res = platform_get_resource_byname(pdev, IORESOURCE_REG, "control");
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_control = res->start; data->reg_control = res->start;
res = platform_get_resource_byname(pdev, IORESOURCE_REG, "blink"); res = platform_get_resource_byname(pdev, IORESOURCE_REG, "blink");
if (!res) { if (!res) {
dev_err(&pdev->dev, "No REG resource for blink\n"); dev_err(&pdev->dev, "No REG resource for blink\n");
ret = -ENXIO; return -ENXIO;
goto out;
} }
data->reg_blink = res->start; data->reg_blink = res->start;
memset(data->name, 0, MFD_NAME_SIZE); memset(data->name, 0, MFD_NAME_SIZE);
...@@ -224,9 +222,6 @@ static int pm860x_led_probe(struct platform_device *pdev) ...@@ -224,9 +222,6 @@ static int pm860x_led_probe(struct platform_device *pdev)
} }
pm860x_led_set(&data->cdev, 0); pm860x_led_set(&data->cdev, 0);
return 0; return 0;
out:
devm_kfree(&pdev->dev, data);
return ret;
} }
static int pm860x_led_remove(struct platform_device *pdev) static int pm860x_led_remove(struct platform_device *pdev)
......
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