From f5710e9761b2610df2a024c777557b3544acf7bd Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Mon, 21 Oct 2024 23:59:27 +0100 Subject: [PATCH] v6.11: platform: Make platform_driver::remove() return void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 0edb555a65d1ef047a9805051c36922b52a38a9d Author: Uwe Kleine-König AuthorDate: Mon Oct 9 12:37:26 2023 +0200 Commit: Uwe Kleine-König CommitDate: Mon May 27 10:34:35 2024 +0200 platform: Make platform_driver::remove() return void struct platform_driver::remove returning an integer made driver authors expect that returning an error code was proper error handling. However the driver core ignores the error and continues to remove the device because there is nothing the core could do anyhow and reentering the remove callback again is only calling for trouble. To prevent such wrong assumptions, change the return type of the remove callback to void. This was prepared by introducing an alternative remove callback returning void and converting all drivers to that. So .remove() can be changed without further changes in drivers. This corresponds to step b) of the plan outlined in commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value"). Signed-off-by: Uwe Kleine-König --- seeed-voicecard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seeed-voicecard.c b/seeed-voicecard.c index 390b8a4..e4b3e8f 100644 --- a/seeed-voicecard.c +++ b/seeed-voicecard.c @@ -890,7 +890,7 @@ err: return ret; } -static int seeed_voice_card_remove(struct platform_device *pdev) +static void seeed_voice_card_remove(struct platform_device *pdev) { struct snd_soc_card *card = platform_get_drvdata(pdev); struct seeed_card_data *priv = snd_soc_card_get_drvdata(card); @@ -899,7 +899,7 @@ static int seeed_voice_card_remove(struct platform_device *pdev) } simple_util_clean_reference(card); - return 0; + return; } static const struct of_device_id seeed_voice_of_match[] = {