[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a1d7dcce-99c4-7e6e-7041-749d16fe0c95@intel.com>
Date: Fri, 14 Jul 2023 10:51:27 +0300
From: Adrian Hunter <adrian.hunter@...el.com>
To: Yangtao Li <frank.li@...o.com>,
Ulf Hansson <ulf.hansson@...aro.org>
Cc: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 26/58] mmc: f-sdh30: Convert to platform remove callback
returning void
On 13/07/23 11:07, Yangtao Li wrote:
> 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@...gutronix.de>
> Signed-off-by: Yangtao Li <frank.li@...o.com>
Doesn't apply anymore. You can check against the "next" branch in:
git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git
> ---
> drivers/mmc/host/sdhci_f_sdh30.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
> index a202a69a4b08..6016e183c03c 100644
> --- a/drivers/mmc/host/sdhci_f_sdh30.c
> +++ b/drivers/mmc/host/sdhci_f_sdh30.c
> @@ -208,7 +208,7 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int sdhci_f_sdh30_remove(struct platform_device *pdev)
> +static void sdhci_f_sdh30_remove(struct platform_device *pdev)
> {
> struct sdhci_host *host = platform_get_drvdata(pdev);
> struct f_sdhost_priv *priv = sdhci_priv(host);
> @@ -222,8 +222,6 @@ static int sdhci_f_sdh30_remove(struct platform_device *pdev)
>
> sdhci_free_host(host);
> platform_set_drvdata(pdev, NULL);
> -
> - return 0;
> }
>
> #ifdef CONFIG_OF
> @@ -252,7 +250,7 @@ static struct platform_driver sdhci_f_sdh30_driver = {
> .pm = &sdhci_pltfm_pmops,
> },
> .probe = sdhci_f_sdh30_probe,
> - .remove = sdhci_f_sdh30_remove,
> + .remove_new = sdhci_f_sdh30_remove,
> };
>
> module_platform_driver(sdhci_f_sdh30_driver);
Powered by blists - more mailing lists