lkml.org 
[lkml]   [2023]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 62/62] mmc: f-sdh30: fix order of function calls in sdhci_f_sdh30_remove
Hello,

On Thu, Aug 03, 2023 at 08:46:08AM +0300, Adrian Hunter wrote:
> On 27/07/23 16:55, Adrian Hunter wrote:
> >> 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
> >
>
> So it needs to end up looking something like below, right?
>
> diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
> index 840084ee72e6..47ae853f51aa 100644
> --- a/drivers/mmc/host/sdhci_f_sdh30.c
> +++ b/drivers/mmc/host/sdhci_f_sdh30.c
> @@ -210,12 +210,15 @@ 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);
> -
> - reset_control_assert(priv->rst);
> - clk_disable_unprepare(priv->clk);
> - clk_disable_unprepare(priv->clk_iface);
> + struct clk *clk_iface = priv->clk_iface;
> + struct reset_control *rst = priv->rst;
> + struct clk *clk = priv->clk;
>
> sdhci_pltfm_unregister(pdev);
> +
> + reset_control_assert(rst);
> + clk_disable_unprepare(clk);
> + clk_disable_unprepare(clk_iface);
> }

Looks right to me.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-08-03 11:53    [W:0.092 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site