[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKekbevGu0rx7UTN925XJDE_SH=NConk4BjQ35ekXa=nN49Jfw@mail.gmail.com>
Date: Fri, 25 Aug 2023 12:22:36 -0400
From: Kamal Dasu <kamal.dasu@...adcom.com>
To: Adrian Hunter <adrian.hunter@...el.com>
Cc: Ulf Hansson <ulf.hansson@...aro.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>, Yangtao Li <frank.li@...o.com>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
Al Cooper <alcooperx@...il.com>,
Michal Simek <michal.simek@....com>,
Eugen Hristev <eugen.hristev@...labora.com>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Claudiu Beznea <claudiu.beznea@...rochip.com>,
Lars Povlsen <lars.povlsen@...rochip.com>,
Steen Hegelund <Steen.Hegelund@...rochip.com>,
Daniel Machon <daniel.machon@...rochip.com>,
UNGLinuxDriver@...rochip.com,
Patrice Chotard <patrice.chotard@...s.st.com>,
Brian Norris <briannorris@...omium.org>,
Ye Xingchen <ye.xingchen@....com.cn>,
Brad Larson <blarson@....com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
Sai Krishna Potthuri <sai.krishna.potthuri@....com>,
Swati Agarwal <swati.agarwal@....com>,
Andy Tang <andy.tang@....com>,
Georgii Kruglov <georgy.kruglov@...dex.ru>,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
Doug Brown <doug@...morgal.com>,
Li Zetao <lizetao1@...wei.com>,
Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
Jassi Brar <jaswinder.singh@...aro.org>,
linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 03/16] mmc: sdhci-brcmstb: Use sdhci_pltfm_remove()
On Fri, Aug 11, 2023 at 9:04 AM Adrian Hunter <adrian.hunter@...el.com> wrote:
>
> Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() so that
> devm_clk_get_optional_enabled() can be used for pltfm_host->clk.
>
> This has the side effect that the order of operations on the error path
> and remove path is not the same as it was before, but should be safe
> nevertheless.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
Reviewed-by : Kamal Dasu <kamal.dasu@...adcom.com>
> ---
> drivers/mmc/host/sdhci-brcmstb.c | 18 +++++-------------
> 1 file changed, 5 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c
> index a2b6d8f2eeb6..c23251bb95f3 100644
> --- a/drivers/mmc/host/sdhci-brcmstb.c
> +++ b/drivers/mmc/host/sdhci-brcmstb.c
> @@ -264,23 +264,17 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
>
> dev_dbg(&pdev->dev, "Probe found match for %s\n", match->compatible);
>
> - clk = devm_clk_get_optional(&pdev->dev, NULL);
> + clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
> if (IS_ERR(clk))
> return dev_err_probe(&pdev->dev, PTR_ERR(clk),
> - "Failed to get clock from Device Tree\n");
> -
> - res = clk_prepare_enable(clk);
> - if (res)
> - return res;
> + "Failed to get and enable clock from Device Tree\n");
>
> memset(&brcmstb_pdata, 0, sizeof(brcmstb_pdata));
> brcmstb_pdata.ops = match_priv->ops;
> host = sdhci_pltfm_init(pdev, &brcmstb_pdata,
> sizeof(struct sdhci_brcmstb_priv));
> - if (IS_ERR(host)) {
> - res = PTR_ERR(host);
> - goto err_clk;
> - }
> + if (IS_ERR(host))
> + return PTR_ERR(host);
>
> pltfm_host = sdhci_priv(host);
> priv = sdhci_pltfm_priv(pltfm_host);
> @@ -369,9 +363,7 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
>
> err:
> sdhci_pltfm_free(pdev);
> -err_clk:
> clk_disable_unprepare(base_clk);
> - clk_disable_unprepare(clk);
> return res;
> }
>
> @@ -430,7 +422,7 @@ static struct platform_driver sdhci_brcmstb_driver = {
> .of_match_table = of_match_ptr(sdhci_brcm_of_match),
> },
> .probe = sdhci_brcmstb_probe,
> - .remove_new = sdhci_pltfm_unregister,
> + .remove_new = sdhci_pltfm_remove,
> .shutdown = sdhci_brcmstb_shutdown,
> };
>
> --
> 2.34.1
>
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4203 bytes)
Powered by blists - more mailing lists