diff mbox series

[038/173] ASoC: bcm: bcm63xx-i2s-whistler: Convert to platform remove callback returning void

Message ID 20230315150745.67084-39-u.kleine-koenig@pengutronix.de (mailing list archive)
State Accepted
Commit ee357de34391b4d1a926c7ef736f1723d07feb9e
Headers show
Series ALSA/ASoC: Convert to platform remove callback returning void | expand

Commit Message

Uwe Kleine-König March 15, 2023, 3:05 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/bcm/bcm63xx-i2s-whistler.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/bcm/bcm63xx-i2s-whistler.c b/sound/soc/bcm/bcm63xx-i2s-whistler.c
index 2da1384ffe91..18c51dbbc8dc 100644
--- a/sound/soc/bcm/bcm63xx-i2s-whistler.c
+++ b/sound/soc/bcm/bcm63xx-i2s-whistler.c
@@ -289,10 +289,9 @@  static int bcm63xx_i2s_dev_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int bcm63xx_i2s_dev_remove(struct platform_device *pdev)
+static void bcm63xx_i2s_dev_remove(struct platform_device *pdev)
 {
 	bcm63xx_soc_platform_remove(pdev);
-	return 0;
 }
 
 #ifdef CONFIG_OF
@@ -308,7 +307,7 @@  static struct platform_driver bcm63xx_i2s_driver = {
 		.of_match_table = of_match_ptr(snd_soc_bcm_audio_match),
 	},
 	.probe = bcm63xx_i2s_dev_probe,
-	.remove = bcm63xx_i2s_dev_remove,
+	.remove_new = bcm63xx_i2s_dev_remove,
 };
 
 module_platform_driver(bcm63xx_i2s_driver);