Skip to content

Commit fed5d59

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: omap-dmtimer: 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 a19cf5a commit fed5d59

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/pwm/pwm-omap-dmtimer.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
441441
return ret;
442442
}
443443

444-
static int pwm_omap_dmtimer_remove(struct platform_device *pdev)
444+
static void pwm_omap_dmtimer_remove(struct platform_device *pdev)
445445
{
446446
struct pwm_omap_dmtimer_chip *omap = platform_get_drvdata(pdev);
447447

@@ -455,8 +455,6 @@ static int pwm_omap_dmtimer_remove(struct platform_device *pdev)
455455
put_device(&omap->dm_timer_pdev->dev);
456456

457457
mutex_destroy(&omap->mutex);
458-
459-
return 0;
460458
}
461459

462460
static const struct of_device_id pwm_omap_dmtimer_of_match[] = {
@@ -471,7 +469,7 @@ static struct platform_driver pwm_omap_dmtimer_driver = {
471469
.of_match_table = of_match_ptr(pwm_omap_dmtimer_of_match),
472470
},
473471
.probe = pwm_omap_dmtimer_probe,
474-
.remove = pwm_omap_dmtimer_remove,
472+
.remove_new = pwm_omap_dmtimer_remove,
475473
};
476474
module_platform_driver(pwm_omap_dmtimer_driver);
477475

0 commit comments

Comments
 (0)