Skip to content

Commit e7fa6e8

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: rcar: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
1 parent fed5d59 commit e7fa6e8

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/pwm/pwm-rcar.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,13 @@ static int rcar_pwm_probe(struct platform_device *pdev)
238238
return 0;
239239
}
240240

241-
static int rcar_pwm_remove(struct platform_device *pdev)
241+
static void rcar_pwm_remove(struct platform_device *pdev)
242242
{
243243
struct rcar_pwm_chip *rcar_pwm = platform_get_drvdata(pdev);
244244

245245
pwmchip_remove(&rcar_pwm->chip);
246246

247247
pm_runtime_disable(&pdev->dev);
248-
249-
return 0;
250248
}
251249

252250
static const struct of_device_id rcar_pwm_of_table[] = {
@@ -257,7 +255,7 @@ MODULE_DEVICE_TABLE(of, rcar_pwm_of_table);
257255

258256
static struct platform_driver rcar_pwm_driver = {
259257
.probe = rcar_pwm_probe,
260-
.remove = rcar_pwm_remove,
258+
.remove_new = rcar_pwm_remove,
261259
.driver = {
262260
.name = "pwm-rcar",
263261
.of_match_table = of_match_ptr(rcar_pwm_of_table),

0 commit comments

Comments
 (0)