Skip to content

Commit

Permalink
leds: leds-88pm860x: drop devm_kfree of devm_kzalloc'd data
Browse files Browse the repository at this point in the history
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: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
  • Loading branch information
Jingoo Han authored and Bryan Wu committed Nov 26, 2012
1 parent 1b21ec5 commit 3651c4b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/leds/leds-88pm860x.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,13 @@ static int pm860x_led_probe(struct platform_device *pdev)
res = platform_get_resource_byname(pdev, IORESOURCE_REG, "control");
if (!res) {
dev_err(&pdev->dev, "No REG resource for control\n");
ret = -ENXIO;
goto out;
return -ENXIO;
}
data->reg_control = res->start;
res = platform_get_resource_byname(pdev, IORESOURCE_REG, "blink");
if (!res) {
dev_err(&pdev->dev, "No REG resource for blink\n");
ret = -ENXIO;
goto out;
return -ENXIO;
}
data->reg_blink = res->start;
memset(data->name, 0, MFD_NAME_SIZE);
Expand Down Expand Up @@ -224,9 +222,6 @@ static int pm860x_led_probe(struct platform_device *pdev)
}
pm860x_led_set(&data->cdev, 0);
return 0;
out:
devm_kfree(&pdev->dev, data);
return ret;
}

static int pm860x_led_remove(struct platform_device *pdev)
Expand Down

0 comments on commit 3651c4b

Please sign in to comment.