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

mmc: sdhci-esdhc-mcf: 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: Angelo Dureghello <angelo.dureghello@timesys.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230727070051.17778-48-frank.li@vivo.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Yangtao Li and committed by
Ulf Hansson
bd0e512b 2ababbdc

+2 -4
+2 -4
drivers/mmc/host/sdhci-esdhc-mcf.c
··· 489 489 return err; 490 490 } 491 491 492 - static int sdhci_esdhc_mcf_remove(struct platform_device *pdev) 492 + static void sdhci_esdhc_mcf_remove(struct platform_device *pdev) 493 493 { 494 494 struct sdhci_host *host = platform_get_drvdata(pdev); 495 495 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); ··· 502 502 clk_disable_unprepare(mcf_data->clk_per); 503 503 504 504 sdhci_pltfm_free(pdev); 505 - 506 - return 0; 507 505 } 508 506 509 507 static struct platform_driver sdhci_esdhc_mcf_driver = { ··· 510 512 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 511 513 }, 512 514 .probe = sdhci_esdhc_mcf_probe, 513 - .remove = sdhci_esdhc_mcf_remove, 515 + .remove_new = sdhci_esdhc_mcf_remove, 514 516 }; 515 517 516 518 module_platform_driver(sdhci_esdhc_mcf_driver);