From: Andi Shyti <andi.shyti@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Andi Shyti <andi.shyti@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Al Cooper <alcooperx@gmail.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Jiri Slaby <jirislaby@kernel.org>
Subject: Re: [PATCH v2 1/1] serial: 8250_bcm7271: Use devm_clk_get_optional_enabled()
Date: Thu, 5 Oct 2023 18:07:58 +0200 [thread overview]
Message-ID: <ZR7fXpps3V2mmiMf@ashyti-mobl2.lan> (raw)
In-Reply-To: <ZR7YLI3t2YDBbNbK@smile.fi.intel.com>
Hi Andy,
On Thu, Oct 05, 2023 at 06:37:16PM +0300, Andy Shevchenko wrote:
> On Thu, Oct 05, 2023 at 05:19:38PM +0200, Andi Shyti wrote:
>
> [...]
>
> > > - baud_mux_clk = devm_clk_get(dev, "sw_baud");
> > > - if (IS_ERR(baud_mux_clk)) {
> > > - if (PTR_ERR(baud_mux_clk) == -EPROBE_DEFER) {
> > > - ret = -EPROBE_DEFER;
> > > - goto release_dma;
> > > - }
> > > - dev_dbg(dev, "BAUD MUX clock not specified\n");
> > > - } else {
> > > + baud_mux_clk = devm_clk_get_optional_enabled(dev, "sw_baud");
> > > + ret = PTR_ERR_OR_ZERO(baud_mux_clk);
> > > + if (ret)
> > > + goto release_dma;
> > > + if (baud_mux_clk) {
> > > dev_dbg(dev, "BAUD MUX clock found\n");
> > > - ret = clk_prepare_enable(baud_mux_clk);
> > > - if (ret)
> > > - goto release_dma;
> > > +
> > > priv->baud_mux_clk = baud_mux_clk;
> > > init_real_clk_rates(dev, priv);
> > > clk_rate = priv->default_mux_rate;
> > > + } else {
> > > + dev_dbg(dev, "BAUD MUX clock not specified\n");
> >
> > little behavioral change here, but I don't think this is a
> > problem.
>
> You meant that "if (!x) else" had been changed to "if (x) else" semantics?
> Otherwise I don't see any difference.
If devm_clk_get() fails with anything but -EPROBE_DEFER
originally the code was not returning, while now it returns.
But still... this is perfectly fine.
Andi
> > Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
>
> Thank you!
>
> --
> With Best Regards,
> Andy Shevchenko
>
prev parent reply other threads:[~2023-10-05 16:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-05 12:45 [PATCH v2 1/1] serial: 8250_bcm7271: Use devm_clk_get_optional_enabled() Andy Shevchenko
2023-10-05 15:19 ` Andi Shyti
2023-10-05 15:37 ` Andy Shevchenko
2023-10-05 16:07 ` Andi Shyti [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=ZR7fXpps3V2mmiMf@ashyti-mobl2.lan \
--to=andi.shyti@linux.intel.com \
--cc=alcooperx@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.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;
as well as URLs for NNTP newsgroup(s).