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

ASoC: mediatek: mt8195-afe-pcm: 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>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-114-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
6461fee6 26530339

+2 -3
+2 -3
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
··· 3253 3253 return ret; 3254 3254 } 3255 3255 3256 - static int mt8195_afe_pcm_dev_remove(struct platform_device *pdev) 3256 + static void mt8195_afe_pcm_dev_remove(struct platform_device *pdev) 3257 3257 { 3258 3258 struct mtk_base_afe *afe = platform_get_drvdata(pdev); 3259 3259 ··· 3264 3264 mt8195_afe_runtime_suspend(&pdev->dev); 3265 3265 3266 3266 mt8195_afe_deinit_clock(afe); 3267 - return 0; 3268 3267 } 3269 3268 3270 3269 static const struct of_device_id mt8195_afe_pcm_dt_match[] = { ··· 3284 3285 .pm = &mt8195_afe_pm_ops, 3285 3286 }, 3286 3287 .probe = mt8195_afe_pcm_dev_probe, 3287 - .remove = mt8195_afe_pcm_dev_remove, 3288 + .remove_new = mt8195_afe_pcm_dev_remove, 3288 3289 }; 3289 3290 3290 3291 module_platform_driver(mt8195_afe_pcm_driver);