From 74a5b94b62217627a00b52f80c640a4a30d53115 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Tue, 14 Mar 2023 11:32:25 +0100 Subject: ARM: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Reviewed-by: Arnd Bergmann Acked-by: Shawn Guo # for imx/mmdc Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230314103225.2787101-1-u.kleine-koenig@pengutronix.de Signed-off-by: Arnd Bergmann --- arch/arm/mach-pxa/sharpsl_pm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c index 929cc51ed7c2..d29bdcd5270e 100644 --- a/arch/arm/mach-pxa/sharpsl_pm.c +++ b/arch/arm/mach-pxa/sharpsl_pm.c @@ -890,7 +890,7 @@ static int sharpsl_pm_probe(struct platform_device *pdev) return 0; } -static int sharpsl_pm_remove(struct platform_device *pdev) +static void sharpsl_pm_remove(struct platform_device *pdev) { suspend_set_ops(NULL); @@ -917,13 +917,11 @@ static int sharpsl_pm_remove(struct platform_device *pdev) del_timer_sync(&sharpsl_pm.chrg_full_timer); del_timer_sync(&sharpsl_pm.ac_timer); - - return 0; } static struct platform_driver sharpsl_pm_driver = { .probe = sharpsl_pm_probe, - .remove = sharpsl_pm_remove, + .remove_new = sharpsl_pm_remove, .suspend = sharpsl_pm_suspend, .resume = sharpsl_pm_resume, .driver = { -- cgit