From 52675c1e9bfaaecc9999b39caf1305a2688df6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 15 Mar 2023 16:05:53 +0100 Subject: [PATCH] ASoC: codecs: wm8998: 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. Signed-off-by: Uwe Kleine-König Acked-by: Charles Keepax Acked-by: Takashi Iwai Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20230315150745.67084-62-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown --- sound/soc/codecs/wm8998.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/wm8998.c b/sound/soc/codecs/wm8998.c index 79fc6bbaa3aa..3c2c4d12c08e 100644 --- a/sound/soc/codecs/wm8998.c +++ b/sound/soc/codecs/wm8998.c @@ -1409,7 +1409,7 @@ err_pm_disable: return ret; } -static int wm8998_remove(struct platform_device *pdev) +static void wm8998_remove(struct platform_device *pdev) { struct wm8998_priv *wm8998 = platform_get_drvdata(pdev); struct arizona *arizona = wm8998->core.arizona; @@ -1419,8 +1419,6 @@ static int wm8998_remove(struct platform_device *pdev) arizona_free_spk_irqs(arizona); arizona_jack_codec_dev_remove(&wm8998->core); - - return 0; } static struct platform_driver wm8998_codec_driver = { @@ -1428,7 +1426,7 @@ static struct platform_driver wm8998_codec_driver = { .name = "wm8998-codec", }, .probe = wm8998_probe, - .remove = wm8998_remove, + .remove_new = wm8998_remove, }; module_platform_driver(wm8998_codec_driver);