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

ASoC: au1x: psc-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-37-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
c167a43d ea7f61db

+2 -4
+2 -4
sound/soc/au1x/psc-ac97.c
··· 421 421 return 0; 422 422 } 423 423 424 - static int au1xpsc_ac97_drvremove(struct platform_device *pdev) 424 + static void au1xpsc_ac97_drvremove(struct platform_device *pdev) 425 425 { 426 426 struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev); 427 427 ··· 434 434 wmb(); /* drain writebuffer */ 435 435 436 436 au1xpsc_ac97_workdata = NULL; /* MDEV */ 437 - 438 - return 0; 439 437 } 440 438 441 439 #ifdef CONFIG_PM ··· 486 488 .pm = AU1XPSCAC97_PMOPS, 487 489 }, 488 490 .probe = au1xpsc_ac97_drvprobe, 489 - .remove = au1xpsc_ac97_drvremove, 491 + .remove_new = au1xpsc_ac97_drvremove, 490 492 }; 491 493 492 494 module_platform_driver(au1xpsc_ac97_driver);