linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: VAMSHI GAJJELA <vamshigajjela@google.com>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: 8250_dw: Emit an error message if getting the baudclk failed
Date: Mon, 26 Feb 2024 18:37:51 +0200	[thread overview]
Message-ID: <Zdy-X37encfcr9g7@smile.fi.intel.com> (raw)
In-Reply-To: <CAMTSyjrKVL12CrXuqJhWydObhYfgLF=zKTE0U0LdzimTT6Sdsw@mail.gmail.com>

On Mon, Feb 26, 2024 at 09:30:53PM +0530, VAMSHI GAJJELA wrote:
> On Thu, Feb 22, 2024 at 4:50 PM Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:

...

> >         if (data->clk == NULL)
> >                 data->clk = devm_clk_get_optional_enabled(dev, NULL);
> >         if (IS_ERR(data->clk))
> > -               return PTR_ERR(data->clk);
> > +               return dev_err_probe(dev, PTR_ERR(data->clk),
> > +                                    "failed to get baudclk\n");
> 
> Not required IMO as the baudclk is optional,

It adds verbosity to the cases when it's defined, but for some reason
can't be retrieved.

> otherwise it might ask
> for a similar change at apb_pclk.

If you need so, yes. Send a patch.

> Could you please provide some insight into the circumstances that lead
> to encountering this error case?
> 
> Also the check is for IS_ERR(data->clk), data-clk could be NULL aswell.

Yes, and that's the case of everything is fine as the clock is optional.
Do you see any problem with that check?

> I see any error should be caught at the following line, provided no
> clock-frequency
> ```
> /* If no clock rate is defined, fail. */
> if (!p->uartclk)
>         return dev_err_probe(dev, -EINVAL, "clock rate not defined\n");
> ```

Not sure what you meant by this. Even if we ask for an optional clock,
the error condition still might happen with many other reasons besides
the absence of the clock.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-02-26 16:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 11:19 [PATCH] serial: 8250_dw: Emit an error message if getting the baudclk failed Uwe Kleine-König
2024-02-22 11:50 ` Ilpo Järvinen
2024-02-22 13:36   ` Uwe Kleine-König
2024-02-22 13:48     ` Ilpo Järvinen
2024-02-22 14:24       ` Uwe Kleine-König
2024-02-22 15:10     ` Andy Shevchenko
2024-02-22 15:11 ` Andy Shevchenko
2024-02-22 18:37   ` Uwe Kleine-König
2024-02-26 16:00 ` VAMSHI GAJJELA
2024-02-26 16:37   ` Andy Shevchenko [this message]
2024-02-28 17:45     ` VAMSHI GAJJELA
2024-02-28 17:59       ` Andy Shevchenko

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=Zdy-X37encfcr9g7@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vamshigajjela@google.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;
as well as URLs for NNTP newsgroup(s).