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

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

authored by

Uwe Kleine-König and committed by
Mark Brown
ed771e2b 4136b45d

+2 -4
+2 -4
sound/soc/sprd/sprd-mcdt.c
··· 973 973 return 0; 974 974 } 975 975 976 - static int sprd_mcdt_remove(struct platform_device *pdev) 976 + static void sprd_mcdt_remove(struct platform_device *pdev) 977 977 { 978 978 struct sprd_mcdt_chan *chan, *temp; 979 979 ··· 983 983 list_del(&chan->list); 984 984 985 985 mutex_unlock(&sprd_mcdt_list_mutex); 986 - 987 - return 0; 988 986 } 989 987 990 988 static const struct of_device_id sprd_mcdt_of_match[] = { ··· 993 995 994 996 static struct platform_driver sprd_mcdt_driver = { 995 997 .probe = sprd_mcdt_probe, 996 - .remove = sprd_mcdt_remove, 998 + .remove_new = sprd_mcdt_remove, 997 999 .driver = { 998 1000 .name = "sprd-mcdt", 999 1001 .of_match_table = sprd_mcdt_of_match,