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

mmc: sdhci-spear: 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>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230727070051.17778-50-frank.li@vivo.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Yangtao Li and committed by
Ulf Hansson
ba082d6e 3ed9c648

+2 -4
+2 -4
drivers/mmc/host/sdhci-spear.c
··· 117 117 return ret; 118 118 } 119 119 120 - static int sdhci_remove(struct platform_device *pdev) 120 + static void sdhci_remove(struct platform_device *pdev) 121 121 { 122 122 struct sdhci_host *host = platform_get_drvdata(pdev); 123 123 struct spear_sdhci *sdhci = sdhci_priv(host); ··· 131 131 sdhci_remove_host(host, dead); 132 132 clk_disable_unprepare(sdhci->clk); 133 133 sdhci_free_host(host); 134 - 135 - return 0; 136 134 } 137 135 138 136 #ifdef CONFIG_PM_SLEEP ··· 182 184 .of_match_table = sdhci_spear_id_table, 183 185 }, 184 186 .probe = sdhci_probe, 185 - .remove = sdhci_remove, 187 + .remove_new = sdhci_remove, 186 188 }; 187 189 188 190 module_platform_driver(sdhci_driver);