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

ALSA: atmel: 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>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-5-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
45cc35e8 3210e62a

+2 -4
+2 -4
sound/atmel/ac97c.c
··· 843 843 #define ATMEL_AC97C_PM_OPS NULL 844 844 #endif 845 845 846 - static int atmel_ac97c_remove(struct platform_device *pdev) 846 + static void atmel_ac97c_remove(struct platform_device *pdev) 847 847 { 848 848 struct snd_card *card = platform_get_drvdata(pdev); 849 849 struct atmel_ac97c *chip = get_chip(card); ··· 858 858 free_irq(chip->irq, chip); 859 859 860 860 snd_card_free(card); 861 - 862 - return 0; 863 861 } 864 862 865 863 static struct platform_driver atmel_ac97c_driver = { 866 864 .probe = atmel_ac97c_probe, 867 - .remove = atmel_ac97c_remove, 865 + .remove_new = atmel_ac97c_remove, 868 866 .driver = { 869 867 .name = "atmel_ac97c", 870 868 .pm = ATMEL_AC97C_PM_OPS,