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

ASoC: meson: aiu: 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: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-115-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

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

+2 -4
+2 -4
sound/soc/meson/aiu.c
··· 331 331 return ret; 332 332 } 333 333 334 - static int aiu_remove(struct platform_device *pdev) 334 + static void aiu_remove(struct platform_device *pdev) 335 335 { 336 336 snd_soc_unregister_component(&pdev->dev); 337 - 338 - return 0; 339 337 } 340 338 341 339 static const struct aiu_platform_data aiu_gxbb_pdata = { ··· 362 364 363 365 static struct platform_driver aiu_pdrv = { 364 366 .probe = aiu_probe, 365 - .remove = aiu_remove, 367 + .remove_new = aiu_remove, 366 368 .driver = { 367 369 .name = "meson-aiu", 368 370 .of_match_table = aiu_of_match,