Skip to content

Commit 91e92e8

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: tiehrpwm: 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 dc75f6b commit 91e92e8

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/pwm/pwm-tiehrpwm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev)
511511
return ret;
512512
}
513513

514-
static int ehrpwm_pwm_remove(struct platform_device *pdev)
514+
static void ehrpwm_pwm_remove(struct platform_device *pdev)
515515
{
516516
struct ehrpwm_pwm_chip *pc = platform_get_drvdata(pdev);
517517

@@ -520,8 +520,6 @@ static int ehrpwm_pwm_remove(struct platform_device *pdev)
520520
clk_unprepare(pc->tbclk);
521521

522522
pm_runtime_disable(&pdev->dev);
523-
524-
return 0;
525523
}
526524

527525
#ifdef CONFIG_PM_SLEEP
@@ -604,7 +602,7 @@ static struct platform_driver ehrpwm_pwm_driver = {
604602
.pm = &ehrpwm_pwm_pm_ops,
605603
},
606604
.probe = ehrpwm_pwm_probe,
607-
.remove = ehrpwm_pwm_remove,
605+
.remove_new = ehrpwm_pwm_remove,
608606
};
609607
module_platform_driver(ehrpwm_pwm_driver);
610608

0 commit comments

Comments
 (0)