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

ASoC: pxa: pxa2xx-ac97: 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-118-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
acb6a698 15c71a4c

+2 -3
+2 -3
sound/soc/pxa/pxa2xx-ac97.c
··· 263 263 pxa_ac97_dai_driver, ARRAY_SIZE(pxa_ac97_dai_driver)); 264 264 } 265 265 266 - static int pxa2xx_ac97_dev_remove(struct platform_device *pdev) 266 + static void pxa2xx_ac97_dev_remove(struct platform_device *pdev) 267 267 { 268 268 struct ac97_controller *ctrl = platform_get_drvdata(pdev); 269 269 270 270 snd_ac97_controller_unregister(ctrl); 271 271 pxa2xx_ac97_hw_remove(pdev); 272 - return 0; 273 272 } 274 273 275 274 #ifdef CONFIG_PM_SLEEP ··· 288 289 289 290 static struct platform_driver pxa2xx_ac97_driver = { 290 291 .probe = pxa2xx_ac97_dev_probe, 291 - .remove = pxa2xx_ac97_dev_remove, 292 + .remove_new = pxa2xx_ac97_dev_remove, 292 293 .driver = { 293 294 .name = "pxa2xx-ac97", 294 295 #ifdef CONFIG_PM_SLEEP