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

mmc: pxamci: 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.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230727070051.17778-29-frank.li@vivo.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Yangtao Li and committed by
Ulf Hansson
fac44eb8 fcbeadbe

+2 -4
+2 -4
drivers/mmc/host/pxamci.c
··· 782 782 return ret; 783 783 } 784 784 785 - static int pxamci_remove(struct platform_device *pdev) 785 + static void pxamci_remove(struct platform_device *pdev) 786 786 { 787 787 struct mmc_host *mmc = platform_get_drvdata(pdev); 788 788 ··· 806 806 807 807 mmc_free_host(mmc); 808 808 } 809 - 810 - return 0; 811 809 } 812 810 813 811 static struct platform_driver pxamci_driver = { 814 812 .probe = pxamci_probe, 815 - .remove = pxamci_remove, 813 + .remove_new = pxamci_remove, 816 814 .driver = { 817 815 .name = DRIVER_NAME, 818 816 .probe_type = PROBE_PREFER_ASYNCHRONOUS,