Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Gaosheng Cui <cuigaosheng1@huawei.com>
Cc: chaotian.jing@mediatek.com, matthias.bgg@gmail.com,
	drinkcat@chromium.org, wenbin.mei@mediatek.com,
	linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] mmc: mtk-sd: Fix missing clk_disable_unprepare in msdc_of_clock_parse()
Date: Tue, 29 Nov 2022 13:54:22 +0100	[thread overview]
Message-ID: <CAPDyKFqZOMO2vA7cr89LBqfzRT==LmU4yZnAkfHub5sZWMmx9g@mail.gmail.com> (raw)
In-Reply-To: <20221125090141.3626747-1-cuigaosheng1@huawei.com>

On Fri, 25 Nov 2022 at 10:01, Gaosheng Cui <cuigaosheng1@huawei.com> wrote:
>
> The clk_disable_unprepare() should be called in the error handling
> of devm_clk_bulk_get_optional, fix it by replacing devm_clk_get_optional
> and clk_prepare_enable by devm_clk_get_optional_enabled.
>
> Fixes: f5eccd94b63f ("mmc: mediatek: Add subsys clock control for MT8192 msdc")
> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>

Applied for fixes and by adding a stable tag, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/mtk-sd.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index 0f06cc5fec86..abadfc319053 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -2605,13 +2605,11 @@ static int msdc_of_clock_parse(struct platform_device *pdev,
>                         return PTR_ERR(host->src_clk_cg);
>         }
>
> -       host->sys_clk_cg = devm_clk_get_optional(&pdev->dev, "sys_cg");
> +       /* If present, always enable for this clock gate */
> +       host->sys_clk_cg = devm_clk_get_optional_enabled(&pdev->dev, "sys_cg");
>         if (IS_ERR(host->sys_clk_cg))
>                 host->sys_clk_cg = NULL;
>
> -       /* If present, always enable for this clock gate */
> -       clk_prepare_enable(host->sys_clk_cg);
> -
>         host->bulk_clks[0].id = "pclk_cg";
>         host->bulk_clks[1].id = "axi_cg";
>         host->bulk_clks[2].id = "ahb_cg";
> --
> 2.25.1
>

      reply	other threads:[~2022-11-29 12:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25  9:01 [PATCH] mmc: mtk-sd: Fix missing clk_disable_unprepare in msdc_of_clock_parse() Gaosheng Cui
2022-11-29 12:54 ` Ulf Hansson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPDyKFqZOMO2vA7cr89LBqfzRT==LmU4yZnAkfHub5sZWMmx9g@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=chaotian.jing@mediatek.com \
    --cc=cuigaosheng1@huawei.com \
    --cc=drinkcat@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=wenbin.mei@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox