diff mbox series

[116/173] ASoC: pxa: mmp-sspa: Convert to platform remove callback returning void

Message ID 20230315150745.67084-117-u.kleine-koenig@pengutronix.de
State Accepted
Commit 15c71a4c84ba66f95c49b50fa934ab0395a1010f
Headers show
Series ALSA/ASoC: Convert to platform remove callback returning void | expand

Commit Message

Uwe Kleine-König March 15, 2023, 3:06 p.m. UTC
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 <u.kleine-koenig@pengutronix.de>
---
 sound/soc/pxa/mmp-sspa.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/pxa/mmp-sspa.c b/sound/soc/pxa/mmp-sspa.c
index b3c1744eff91..a1ed141b8795 100644
--- a/sound/soc/pxa/mmp-sspa.c
+++ b/sound/soc/pxa/mmp-sspa.c
@@ -545,7 +545,7 @@  static int asoc_mmp_sspa_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int asoc_mmp_sspa_remove(struct platform_device *pdev)
+static void asoc_mmp_sspa_remove(struct platform_device *pdev)
 {
 	struct sspa_priv *sspa = platform_get_drvdata(pdev);
 
@@ -553,11 +553,10 @@  static int asoc_mmp_sspa_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 
 	if (pdev->dev.of_node)
-		return 0;
+		return;
 
 	clk_put(sspa->audio_clk);
 	clk_put(sspa->sysclk);
-	return 0;
 }
 
 #ifdef CONFIG_OF
@@ -575,7 +574,7 @@  static struct platform_driver asoc_mmp_sspa_driver = {
 		.of_match_table = of_match_ptr(mmp_sspa_of_match),
 	},
 	.probe = asoc_mmp_sspa_probe,
-	.remove = asoc_mmp_sspa_remove,
+	.remove_new = asoc_mmp_sspa_remove,
 };
 
 module_platform_driver(asoc_mmp_sspa_driver);