linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Li Zhong <floridsleeves@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-serial@vger.kernel.org, etremblay@distech-controls.com,
	l.sanfilippo@kunbus.com, u.kleine-koenig@pengutronix.de,
	robert.hancock@calian.com, ilpo.jarvinen@linux.intel.com,
	matthias.bgg@gmail.com, p.zabel@pengutronix.de,
	jirislaby@kernel.org
Subject: Re: [PATCH v1] drivers/tty/serial/8250: check the return value of clk_prepare_enable()
Date: Mon, 19 Sep 2022 11:32:24 +0200	[thread overview]
Message-ID: <Yyg3KKDCLaQUb2P0@kroah.com> (raw)
In-Reply-To: <20220919085455.1582310-1-floridsleeves@gmail.com>

On Mon, Sep 19, 2022 at 01:54:55AM -0700, Li Zhong wrote:
> Check the return value of clk_prepare_enable() which could fail when
> cannot enable the clock.
> 
> Signed-off-by: Li Zhong <floridsleeves@gmail.com>
> ---
>  drivers/tty/serial/8250/8250_of.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
> index 1b461fba15a3..23e9b9e8c940 100644
> --- a/drivers/tty/serial/8250/8250_of.c
> +++ b/drivers/tty/serial/8250/8250_of.c
> @@ -298,7 +298,8 @@ static int of_serial_resume(struct device *dev)
>  
>  	if (!uart_console(port) || console_suspend_enabled) {
>  		pm_runtime_get_sync(dev);
> -		clk_prepare_enable(info->clk);
> +		if (clk_prepare_enable(info->clk) < 0)
> +			dev_warn(dev, "can't enable clk.\n");

Again, you check but do nothing with the error :(

      reply	other threads:[~2022-09-19  9:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19  8:54 [PATCH v1] drivers/tty/serial/8250: check the return value of clk_prepare_enable() Li Zhong
2022-09-19  9:32 ` Greg KH [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=Yyg3KKDCLaQUb2P0@kroah.com \
    --to=greg@kroah.com \
    --cc=etremblay@distech-controls.com \
    --cc=floridsleeves@gmail.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=l.sanfilippo@kunbus.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robert.hancock@calian.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).