From: Uwe Kleine-König Date: Wed, 15 Mar 2023 15:06:49 +0000 (+0100) Subject: ASoC: pxa: pxa2xx-ac97: Convert to platform remove callback returning void X-Git-Tag: v6.6.7~2882^2~8^2~110^2~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=acb6a6982d6b83c08014f5110b443f4e8bca459b;p=platform%2Fkernel%2Flinux-starfive.git ASoC: pxa: pxa2xx-ac97: 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 Acked-by: Takashi Iwai Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20230315150745.67084-118-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown --- diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 809ea34..e73bd62 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -263,13 +263,12 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) pxa_ac97_dai_driver, ARRAY_SIZE(pxa_ac97_dai_driver)); } -static int pxa2xx_ac97_dev_remove(struct platform_device *pdev) +static void pxa2xx_ac97_dev_remove(struct platform_device *pdev) { struct ac97_controller *ctrl = platform_get_drvdata(pdev); snd_ac97_controller_unregister(ctrl); pxa2xx_ac97_hw_remove(pdev); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -289,7 +288,7 @@ static SIMPLE_DEV_PM_OPS(pxa2xx_ac97_pm_ops, static struct platform_driver pxa2xx_ac97_driver = { .probe = pxa2xx_ac97_dev_probe, - .remove = pxa2xx_ac97_dev_remove, + .remove_new = pxa2xx_ac97_dev_remove, .driver = { .name = "pxa2xx-ac97", #ifdef CONFIG_PM_SLEEP