From: Damien Le Moal <dlemoal@kernel.org>
To: Chen Ni <nichen@iscas.ac.cn>,
linus.walleij@linaro.org, cassel@kernel.org
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ata: sata_gemini: Add check for clk_enable
Date: Wed, 3 Apr 2024 12:56:17 +0900 [thread overview]
Message-ID: <679e665c-73cf-4dfb-ad86-efc799b3f8e3@kernel.org> (raw)
In-Reply-To: <20240403034314.3623830-1-nichen@iscas.ac.cn>
On 4/3/24 12:43, Chen Ni wrote:
> As the potential failure of the clk_enable(), it should be better to
> check it and return error if fails.
Simplify please:
The call to clk_enable() in gemini_sata_start_bridge() can fail. Add a check to
detect such failure.
>
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
> ---
> drivers/ata/sata_gemini.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/ata/sata_gemini.c b/drivers/ata/sata_gemini.c
> index 400b22ee99c3..4c270999ba3c 100644
> --- a/drivers/ata/sata_gemini.c
> +++ b/drivers/ata/sata_gemini.c
> @@ -200,7 +200,10 @@ int gemini_sata_start_bridge(struct sata_gemini *sg, unsigned int bridge)
> pclk = sg->sata0_pclk;
> else
> pclk = sg->sata1_pclk;
> - clk_enable(pclk);
> + ret = clk_enable(pclk);
> + if (ret)
> + return ret;
> +
> msleep(10);
>
> /* Do not keep clocking a bridge that is not online */
--
Damien Le Moal
Western Digital Research
prev parent reply other threads:[~2024-04-03 3:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-03 3:43 [PATCH] ata: sata_gemini: Add check for clk_enable Chen Ni
2024-04-03 3:56 ` Damien Le Moal [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=679e665c-73cf-4dfb-ad86-efc799b3f8e3@kernel.org \
--to=dlemoal@kernel.org \
--cc=cassel@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nichen@iscas.ac.cn \
/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