mmc: alcor: 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-40-frank.li@vivo.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Yangtao Li 2023-07-27 15:00:29 +08:00 committed by Ulf Hansson
parent a7dde463c7
commit 9f13caa4cb

View file

@ -1125,7 +1125,7 @@ free_host:
return ret; return ret;
} }
static int alcor_pci_sdmmc_drv_remove(struct platform_device *pdev) static void alcor_pci_sdmmc_drv_remove(struct platform_device *pdev)
{ {
struct alcor_sdmmc_host *host = dev_get_drvdata(&pdev->dev); struct alcor_sdmmc_host *host = dev_get_drvdata(&pdev->dev);
struct mmc_host *mmc = mmc_from_priv(host); struct mmc_host *mmc = mmc_from_priv(host);
@ -1136,8 +1136,6 @@ static int alcor_pci_sdmmc_drv_remove(struct platform_device *pdev)
alcor_hw_uninit(host); alcor_hw_uninit(host);
mmc_remove_host(mmc); mmc_remove_host(mmc);
mmc_free_host(mmc); mmc_free_host(mmc);
return 0;
} }
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
@ -1177,7 +1175,7 @@ MODULE_DEVICE_TABLE(platform, alcor_pci_sdmmc_ids);
static struct platform_driver alcor_pci_sdmmc_driver = { static struct platform_driver alcor_pci_sdmmc_driver = {
.probe = alcor_pci_sdmmc_drv_probe, .probe = alcor_pci_sdmmc_drv_probe,
.remove = alcor_pci_sdmmc_drv_remove, .remove_new = alcor_pci_sdmmc_drv_remove,
.id_table = alcor_pci_sdmmc_ids, .id_table = alcor_pci_sdmmc_ids,
.driver = { .driver = {
.name = DRV_NAME_ALCOR_PCI_SDMMC, .name = DRV_NAME_ALCOR_PCI_SDMMC,