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

mmc: mxs-mmc: 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-24-frank.li@vivo.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Yangtao Li and committed by
Ulf Hansson
3f347f2c f8c9b415

+2 -4
+2 -4
drivers/mmc/host/mxs-mmc.c
··· 673 673 return ret; 674 674 } 675 675 676 - static int mxs_mmc_remove(struct platform_device *pdev) 676 + static void mxs_mmc_remove(struct platform_device *pdev) 677 677 { 678 678 struct mmc_host *mmc = platform_get_drvdata(pdev); 679 679 struct mxs_mmc_host *host = mmc_priv(mmc); ··· 687 687 clk_disable_unprepare(ssp->clk); 688 688 689 689 mmc_free_host(mmc); 690 - 691 - return 0; 692 690 } 693 691 694 692 #ifdef CONFIG_PM_SLEEP ··· 714 716 715 717 static struct platform_driver mxs_mmc_driver = { 716 718 .probe = mxs_mmc_probe, 717 - .remove = mxs_mmc_remove, 719 + .remove_new = mxs_mmc_remove, 718 720 .driver = { 719 721 .name = DRIVER_NAME, 720 722 .probe_type = PROBE_PREFER_ASYNCHRONOUS,