mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
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:
parent
a7dde463c7
commit
9f13caa4cb
@ -1125,7 +1125,7 @@ free_host:
|
||||
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 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);
|
||||
mmc_remove_host(mmc);
|
||||
mmc_free_host(mmc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
@ -1177,7 +1175,7 @@ MODULE_DEVICE_TABLE(platform, alcor_pci_sdmmc_ids);
|
||||
|
||||
static struct platform_driver alcor_pci_sdmmc_driver = {
|
||||
.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,
|
||||
.driver = {
|
||||
.name = DRV_NAME_ALCOR_PCI_SDMMC,
|
||||
|
Loading…
Reference in New Issue
Block a user