From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Wu Bo <bo.wu@vivo.com>
Cc: <linux-kernel@vger.kernel.org>, Shawn Guo <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
<imx@lists.linux.dev>, <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2] bus: imx-weim: change to use devm_clk_get_enabled() helpers
Date: Fri, 23 Aug 2024 13:12:42 +0100 [thread overview]
Message-ID: <20240823131242.000070b2@Huawei.com> (raw)
In-Reply-To: <9bcf916828934b497ea13d27405105159aef1bff.1724408198.git.bo.wu@vivo.com>
On Fri, 23 Aug 2024 04:22:11 -0600
Wu Bo <bo.wu@vivo.com> wrote:
> Make the code cleaner and avoid call clk_disable_unprepare()
>
> Signed-off-by: Wu Bo <bo.wu@vivo.com>
> ---
> drivers/bus/imx-weim.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
> index 837bf9d51c6e..81483461b514 100644
> --- a/drivers/bus/imx-weim.c
> +++ b/drivers/bus/imx-weim.c
> @@ -282,19 +282,13 @@ static int weim_probe(struct platform_device *pdev)
> dev_set_drvdata(&pdev->dev, priv);
>
> /* get the clock */
> - clk = devm_clk_get(&pdev->dev, NULL);
> + clk = devm_clk_get_enabled(&pdev->dev, NULL);
> if (IS_ERR(clk))
> return PTR_ERR(clk);
>
> - ret = clk_prepare_enable(clk);
> - if (ret)
> - return ret;
> -
> /* parse the device node */
> ret = weim_parse_dt(pdev);
> - if (ret)
if (ret)
return ret;
dev_info()
return 0;
> - clk_disable_unprepare(clk);
> - else
> + if (!ret)
> dev_info(&pdev->dev, "Driver registered.\n");
>
> return ret;
prev parent reply other threads:[~2024-08-23 12:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 10:22 [PATCH 1/2] bus: imx-weim: support compile test Wu Bo
2024-08-23 10:22 ` [PATCH 2/2] bus: imx-weim: change to use devm_clk_get_enabled() helpers Wu Bo
2024-08-23 12:12 ` Jonathan Cameron [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=20240823131242.000070b2@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=bo.wu@vivo.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/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