From: "Yong Wu (吴勇)" <Yong.Wu@mediatek.com>
To: "linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"krzk@kernel.org" <krzk@kernel.org>,
"honghui.zhang@mediatek.com" <honghui.zhang@mediatek.com>,
"jroedel@suse.de" <jroedel@suse.de>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"rongqianfeng@vivo.com" <rongqianfeng@vivo.com>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"angelogioacchino.delregno@collabora.com"
<angelogioacchino.delregno@collabora.com>
Cc: "opensource.kernel@vivo.com" <opensource.kernel@vivo.com>
Subject: Re: [PATCH v2] memory: mtk-smi: Use devm_clk_get_enabled()
Date: Wed, 21 Aug 2024 08:01:00 +0000 [thread overview]
Message-ID: <20bf47ec857e02a61477dd9eefc19a7a1bc963ed.camel@mediatek.com> (raw)
In-Reply-To: <20240821032558.43052-1-rongqianfeng@vivo.com>
On Wed, 2024-08-21 at 11:25 +0800, Rong Qianfeng wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> Replace devm_clk_get() and clk_prepare_enable() with
>
> devm_clk_get_enabled() in .probe().
>
>
>
> Fix the bug of missing clk_disable_unprepare() in .remove() by
>
> using devm_clk_get_enabled() that can disables and unprepares
>
> it automatically on driver detach.
>
>
> Fixes: 3c8f4ad85c4b ("memory/mediatek: add support for mt2701")
>
> Cc: honghui.zhang@mediatek.com
>
> Signed-off-by: Rong Qianfeng <rongqianfeng@vivo.com>
Reviewed-by: Yong Wu <yong.wu@mediatek.com>
> ---
>
> Version 2 changes:
>
> 1. Modified the patch description as suggested by Krzysztof.
>
>
> drivers/memory/mtk-smi.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> index fbe52ecc0eca..2bc034dff691 100644
> --- a/drivers/memory/mtk-smi.c
> +++ b/drivers/memory/mtk-smi.c
> @@ -771,13 +771,9 @@ static int mtk_smi_common_probe(struct
> platform_device *pdev)
> if (IS_ERR(common->smi_ao_base))
> return PTR_ERR(common->smi_ao_base);
>
> - common->clk_async = devm_clk_get(dev, "async");
> + common->clk_async = devm_clk_get_enabled(dev, "async");
> if (IS_ERR(common->clk_async))
> return PTR_ERR(common->clk_async);
> -
> - ret = clk_prepare_enable(common->clk_async);
> - if (ret)
> - return ret;
> } else {
> common->base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(common->base))
> --
> 2.39.0
>
next prev parent reply other threads:[~2024-08-21 8:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 3:25 Rong Qianfeng
2024-08-21 8:01 ` Yong Wu (吴勇) [this message]
2024-08-25 12:22 ` Krzysztof Kozlowski
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=20bf47ec857e02a61477dd9eefc19a7a1bc963ed.camel@mediatek.com \
--to=yong.wu@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=honghui.zhang@mediatek.com \
--cc=jroedel@suse.de \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=opensource.kernel@vivo.com \
--cc=rongqianfeng@vivo.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
all inboxes | Powered by JetHome®