Re: [PATCH v3 62/62] mmc: f-sdh30: fix order of function calls in sdhci_f_sdh30_remove

From: Adrian Hunter
Date: Thu Jul 27 2023 - 09:55:53 EST


On 27/07/23 10:00, Yangtao Li wrote:
> The order of function calls in sdhci_f_sdh30_remove is wrong,
> let's call sdhci_pltfm_unregister first.
>
> Cc: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
> Fixes: 5def5c1c15bf ("mmc: sdhci-f-sdh30: Replace with sdhci_pltfm")
> Signed-off-by: Yangtao Li <frank.li@xxxxxxxx>
> ---
> drivers/mmc/host/sdhci_f_sdh30.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
> index 840084ee72e6..964fa18a61a4 100644
> --- a/drivers/mmc/host/sdhci_f_sdh30.c
> +++ b/drivers/mmc/host/sdhci_f_sdh30.c
> @@ -211,11 +211,11 @@ static void sdhci_f_sdh30_remove(struct platform_device *pdev)
> struct sdhci_host *host = platform_get_drvdata(pdev);
> struct f_sdhost_priv *priv = sdhci_f_sdhost_priv(host);
>
> + sdhci_pltfm_unregister(pdev);

That also frees priv

> +
> reset_control_assert(priv->rst);
> clk_disable_unprepare(priv->clk);
> clk_disable_unprepare(priv->clk_iface);
> -
> - sdhci_pltfm_unregister(pdev);
> }
>
> #ifdef CONFIG_OF