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>
Acked-by: Florian Fainelli <florian.fainelli@broadcom.com> # Broadcom
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230727070051.17778-57-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:46 +08:00 committed by Ulf Hansson
parent 80c602b114
commit 1691c261ae
11 changed files with 11 additions and 13 deletions

View File

@ -318,7 +318,7 @@ static struct platform_driver sdhci_bcm_kona_driver = {
.of_match_table = sdhci_bcm_kona_of_match, .of_match_table = sdhci_bcm_kona_of_match,
}, },
.probe = sdhci_bcm_kona_probe, .probe = sdhci_bcm_kona_probe,
.remove = sdhci_pltfm_unregister, .remove_new = sdhci_pltfm_unregister,
}; };
module_platform_driver(sdhci_bcm_kona_driver); module_platform_driver(sdhci_bcm_kona_driver);

View File

@ -430,7 +430,7 @@ static struct platform_driver sdhci_brcmstb_driver = {
.of_match_table = of_match_ptr(sdhci_brcm_of_match), .of_match_table = of_match_ptr(sdhci_brcm_of_match),
}, },
.probe = sdhci_brcmstb_probe, .probe = sdhci_brcmstb_probe,
.remove = sdhci_pltfm_unregister, .remove_new = sdhci_pltfm_unregister,
.shutdown = sdhci_brcmstb_shutdown, .shutdown = sdhci_brcmstb_shutdown,
}; };

View File

@ -617,7 +617,7 @@ static struct platform_driver sdhci_cdns_driver = {
.of_match_table = sdhci_cdns_match, .of_match_table = sdhci_cdns_match,
}, },
.probe = sdhci_cdns_probe, .probe = sdhci_cdns_probe,
.remove = sdhci_pltfm_unregister, .remove_new = sdhci_pltfm_unregister,
}; };
module_platform_driver(sdhci_cdns_driver); module_platform_driver(sdhci_cdns_driver);

View File

@ -110,7 +110,7 @@ static struct platform_driver sdhci_dove_driver = {
.of_match_table = sdhci_dove_of_match_table, .of_match_table = sdhci_dove_of_match_table,
}, },
.probe = sdhci_dove_probe, .probe = sdhci_dove_probe,
.remove = sdhci_pltfm_unregister, .remove_new = sdhci_pltfm_unregister,
}; };
module_platform_driver(sdhci_dove_driver); module_platform_driver(sdhci_dove_driver);

View File

@ -432,7 +432,7 @@ static struct platform_driver sdhci_iproc_driver = {
.pm = &sdhci_pltfm_pmops, .pm = &sdhci_pltfm_pmops,
}, },
.probe = sdhci_iproc_probe, .probe = sdhci_iproc_probe,
.remove = sdhci_pltfm_unregister, .remove_new = sdhci_pltfm_unregister,
.shutdown = sdhci_iproc_shutdown, .shutdown = sdhci_iproc_shutdown,
}; };
module_platform_driver(sdhci_iproc_driver); module_platform_driver(sdhci_iproc_driver);

View File

@ -1521,7 +1521,7 @@ static struct platform_driver sdhci_esdhc_driver = {
.pm = &esdhc_of_dev_pm_ops, .pm = &esdhc_of_dev_pm_ops,
}, },
.probe = sdhci_esdhc_probe, .probe = sdhci_esdhc_probe,
.remove = sdhci_pltfm_unregister, .remove_new = sdhci_pltfm_unregister,
}; };
module_platform_driver(sdhci_esdhc_driver); module_platform_driver(sdhci_esdhc_driver);

View File

@ -85,7 +85,7 @@ static struct platform_driver sdhci_hlwd_driver = {
.pm = &sdhci_pltfm_pmops, .pm = &sdhci_pltfm_pmops,
}, },
.probe = sdhci_hlwd_probe, .probe = sdhci_hlwd_probe,
.remove = sdhci_pltfm_unregister, .remove_new = sdhci_pltfm_unregister,
}; };
module_platform_driver(sdhci_hlwd_driver); module_platform_driver(sdhci_hlwd_driver);

View File

@ -260,7 +260,7 @@ static struct platform_driver sdhci_sparx5_driver = {
.pm = &sdhci_pltfm_pmops, .pm = &sdhci_pltfm_pmops,
}, },
.probe = sdhci_sparx5_probe, .probe = sdhci_sparx5_probe,
.remove = sdhci_pltfm_unregister, .remove_new = sdhci_pltfm_unregister,
}; };
module_platform_driver(sdhci_sparx5_driver); module_platform_driver(sdhci_sparx5_driver);

View File

@ -187,7 +187,7 @@ int sdhci_pltfm_register(struct platform_device *pdev,
} }
EXPORT_SYMBOL_GPL(sdhci_pltfm_register); EXPORT_SYMBOL_GPL(sdhci_pltfm_register);
int sdhci_pltfm_unregister(struct platform_device *pdev) void sdhci_pltfm_unregister(struct platform_device *pdev)
{ {
struct sdhci_host *host = platform_get_drvdata(pdev); struct sdhci_host *host = platform_get_drvdata(pdev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@ -196,8 +196,6 @@ int sdhci_pltfm_unregister(struct platform_device *pdev)
sdhci_remove_host(host, dead); sdhci_remove_host(host, dead);
clk_disable_unprepare(pltfm_host->clk); clk_disable_unprepare(pltfm_host->clk);
sdhci_pltfm_free(pdev); sdhci_pltfm_free(pdev);
return 0;
} }
EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister); EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister);

View File

@ -102,7 +102,7 @@ extern void sdhci_pltfm_free(struct platform_device *pdev);
extern int sdhci_pltfm_register(struct platform_device *pdev, extern int sdhci_pltfm_register(struct platform_device *pdev,
const struct sdhci_pltfm_data *pdata, const struct sdhci_pltfm_data *pdata,
size_t priv_size); size_t priv_size);
extern int sdhci_pltfm_unregister(struct platform_device *pdev); extern void sdhci_pltfm_unregister(struct platform_device *pdev);
extern unsigned int sdhci_pltfm_clk_get_max_clock(struct sdhci_host *host); extern unsigned int sdhci_pltfm_clk_get_max_clock(struct sdhci_host *host);

View File

@ -358,7 +358,7 @@ static struct platform_driver sdhci_pxav2_driver = {
.pm = &sdhci_pltfm_pmops, .pm = &sdhci_pltfm_pmops,
}, },
.probe = sdhci_pxav2_probe, .probe = sdhci_pxav2_probe,
.remove = sdhci_pltfm_unregister, .remove_new = sdhci_pltfm_unregister,
}; };
module_platform_driver(sdhci_pxav2_driver); module_platform_driver(sdhci_pxav2_driver);