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

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

authored by

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

+2 -4
+2 -4
sound/soc/au1x/psc-i2s.c
··· 344 344 &au1xpsc_i2s_component, &wd->dai_drv, 1); 345 345 } 346 346 347 - static int au1xpsc_i2s_drvremove(struct platform_device *pdev) 347 + static void au1xpsc_i2s_drvremove(struct platform_device *pdev) 348 348 { 349 349 struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev); 350 350 ··· 352 352 wmb(); /* drain writebuffer */ 353 353 __raw_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 354 354 wmb(); /* drain writebuffer */ 355 - 356 - return 0; 357 355 } 358 356 359 357 #ifdef CONFIG_PM ··· 404 406 .pm = AU1XPSCI2S_PMOPS, 405 407 }, 406 408 .probe = au1xpsc_i2s_drvprobe, 407 - .remove = au1xpsc_i2s_drvremove, 409 + .remove_new = au1xpsc_i2s_drvremove, 408 410 }; 409 411 410 412 module_platform_driver(au1xpsc_i2s_driver);