mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-13 05:54:23 +08:00
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:
parent
80c602b114
commit
1691c261ae
@ -318,7 +318,7 @@ static struct platform_driver sdhci_bcm_kona_driver = {
|
||||
.of_match_table = sdhci_bcm_kona_of_match,
|
||||
},
|
||||
.probe = sdhci_bcm_kona_probe,
|
||||
.remove = sdhci_pltfm_unregister,
|
||||
.remove_new = sdhci_pltfm_unregister,
|
||||
};
|
||||
module_platform_driver(sdhci_bcm_kona_driver);
|
||||
|
||||
|
@ -430,7 +430,7 @@ static struct platform_driver sdhci_brcmstb_driver = {
|
||||
.of_match_table = of_match_ptr(sdhci_brcm_of_match),
|
||||
},
|
||||
.probe = sdhci_brcmstb_probe,
|
||||
.remove = sdhci_pltfm_unregister,
|
||||
.remove_new = sdhci_pltfm_unregister,
|
||||
.shutdown = sdhci_brcmstb_shutdown,
|
||||
};
|
||||
|
||||
|
@ -617,7 +617,7 @@ static struct platform_driver sdhci_cdns_driver = {
|
||||
.of_match_table = sdhci_cdns_match,
|
||||
},
|
||||
.probe = sdhci_cdns_probe,
|
||||
.remove = sdhci_pltfm_unregister,
|
||||
.remove_new = sdhci_pltfm_unregister,
|
||||
};
|
||||
module_platform_driver(sdhci_cdns_driver);
|
||||
|
||||
|
@ -110,7 +110,7 @@ static struct platform_driver sdhci_dove_driver = {
|
||||
.of_match_table = sdhci_dove_of_match_table,
|
||||
},
|
||||
.probe = sdhci_dove_probe,
|
||||
.remove = sdhci_pltfm_unregister,
|
||||
.remove_new = sdhci_pltfm_unregister,
|
||||
};
|
||||
|
||||
module_platform_driver(sdhci_dove_driver);
|
||||
|
@ -432,7 +432,7 @@ static struct platform_driver sdhci_iproc_driver = {
|
||||
.pm = &sdhci_pltfm_pmops,
|
||||
},
|
||||
.probe = sdhci_iproc_probe,
|
||||
.remove = sdhci_pltfm_unregister,
|
||||
.remove_new = sdhci_pltfm_unregister,
|
||||
.shutdown = sdhci_iproc_shutdown,
|
||||
};
|
||||
module_platform_driver(sdhci_iproc_driver);
|
||||
|
@ -1521,7 +1521,7 @@ static struct platform_driver sdhci_esdhc_driver = {
|
||||
.pm = &esdhc_of_dev_pm_ops,
|
||||
},
|
||||
.probe = sdhci_esdhc_probe,
|
||||
.remove = sdhci_pltfm_unregister,
|
||||
.remove_new = sdhci_pltfm_unregister,
|
||||
};
|
||||
|
||||
module_platform_driver(sdhci_esdhc_driver);
|
||||
|
@ -85,7 +85,7 @@ static struct platform_driver sdhci_hlwd_driver = {
|
||||
.pm = &sdhci_pltfm_pmops,
|
||||
},
|
||||
.probe = sdhci_hlwd_probe,
|
||||
.remove = sdhci_pltfm_unregister,
|
||||
.remove_new = sdhci_pltfm_unregister,
|
||||
};
|
||||
|
||||
module_platform_driver(sdhci_hlwd_driver);
|
||||
|
@ -260,7 +260,7 @@ static struct platform_driver sdhci_sparx5_driver = {
|
||||
.pm = &sdhci_pltfm_pmops,
|
||||
},
|
||||
.probe = sdhci_sparx5_probe,
|
||||
.remove = sdhci_pltfm_unregister,
|
||||
.remove_new = sdhci_pltfm_unregister,
|
||||
};
|
||||
|
||||
module_platform_driver(sdhci_sparx5_driver);
|
||||
|
@ -187,7 +187,7 @@ int sdhci_pltfm_register(struct platform_device *pdev,
|
||||
}
|
||||
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_pltfm_host *pltfm_host = sdhci_priv(host);
|
||||
@ -196,8 +196,6 @@ int sdhci_pltfm_unregister(struct platform_device *pdev)
|
||||
sdhci_remove_host(host, dead);
|
||||
clk_disable_unprepare(pltfm_host->clk);
|
||||
sdhci_pltfm_free(pdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister);
|
||||
|
||||
|
@ -102,7 +102,7 @@ extern void sdhci_pltfm_free(struct platform_device *pdev);
|
||||
extern int sdhci_pltfm_register(struct platform_device *pdev,
|
||||
const struct sdhci_pltfm_data *pdata,
|
||||
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);
|
||||
|
||||
|
@ -358,7 +358,7 @@ static struct platform_driver sdhci_pxav2_driver = {
|
||||
.pm = &sdhci_pltfm_pmops,
|
||||
},
|
||||
.probe = sdhci_pxav2_probe,
|
||||
.remove = sdhci_pltfm_unregister,
|
||||
.remove_new = sdhci_pltfm_unregister,
|
||||
};
|
||||
|
||||
module_platform_driver(sdhci_pxav2_driver);
|
||||
|
Loading…
Reference in New Issue
Block a user