Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: codecs: lpass-tx-macro: 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 <u.kleine-koenig@pengutronix.de>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-51-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
10b4f1ed 5b068772

+2 -4
+2 -4
sound/soc/codecs/lpass-tx-macro.c
··· 2076 2076 return ret; 2077 2077 } 2078 2078 2079 - static int tx_macro_remove(struct platform_device *pdev) 2079 + static void tx_macro_remove(struct platform_device *pdev) 2080 2080 { 2081 2081 struct tx_macro *tx = dev_get_drvdata(&pdev->dev); 2082 2082 ··· 2087 2087 clk_disable_unprepare(tx->fsgen); 2088 2088 2089 2089 lpass_macro_pds_exit(tx->pds); 2090 - 2091 - return 0; 2092 2090 } 2093 2091 2094 2092 static int __maybe_unused tx_macro_runtime_suspend(struct device *dev) ··· 2158 2160 .pm = &tx_macro_pm_ops, 2159 2161 }, 2160 2162 .probe = tx_macro_probe, 2161 - .remove = tx_macro_remove, 2163 + .remove_new = tx_macro_remove, 2162 2164 }; 2163 2165 2164 2166 module_platform_driver(tx_macro_driver);