Skip to content

Commit 9eb950e

Browse files
Uwe Kleine-Könignmenon
authored andcommitted
soc/ti: pm33xx: 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). 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> Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-37-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent af97160 commit 9eb950e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/soc/ti/pm33xx.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ static int am33xx_pm_probe(struct platform_device *pdev)
583583
return ret;
584584
}
585585

586-
static int am33xx_pm_remove(struct platform_device *pdev)
586+
static void am33xx_pm_remove(struct platform_device *pdev)
587587
{
588588
pm_runtime_put_sync(&pdev->dev);
589589
pm_runtime_disable(&pdev->dev);
@@ -594,15 +594,14 @@ static int am33xx_pm_remove(struct platform_device *pdev)
594594
am33xx_pm_free_sram();
595595
iounmap(rtc_base_virt);
596596
clk_put(rtc_fck);
597-
return 0;
598597
}
599598

600599
static struct platform_driver am33xx_pm_driver = {
601600
.driver = {
602601
.name = "pm33xx",
603602
},
604603
.probe = am33xx_pm_probe,
605-
.remove = am33xx_pm_remove,
604+
.remove_new = am33xx_pm_remove,
606605
};
607606
module_platform_driver(am33xx_pm_driver);
608607

0 commit comments

Comments
 (0)