linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Etienne Carriere <etienne.carriere@st.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	linux-iio <linux-iio@vger.kernel.org>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Alexandru Ardelean <alexandru.ardelean@analog.com>,
	Fabrice Gasnier <fabrice.gasnier@st.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH v2] iio: adc: stm32: Simplify with dev_err_probe()
Date: Thu, 27 Aug 2020 21:06:52 +0200	[thread overview]
Message-ID: <20200827190652.GD6196@kozik-lap> (raw)
In-Reply-To: <CAHp75Vf3s0+RrHnBoO4y4+t4Egth4uyYwtO5iPt9DbLJcunL6g@mail.gmail.com>

On Thu, Aug 27, 2020 at 11:27:12AM +0300, Andy Shevchenko wrote:
> On Wed, Aug 26, 2020 at 7:19 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> >
> > Common pattern of handling deferred probe can be simplified with
> > dev_err_probe().  Less code and also it prints the error value.
> 
> 
> 
> 
> 
> 
> >         priv->aclk = devm_clk_get(&pdev->dev, "adc");
> >         if (IS_ERR(priv->aclk)) {
> >                 ret = PTR_ERR(priv->aclk);
> > -               if (ret != -ENOENT) {
> > -                       if (ret != -EPROBE_DEFER)
> > -                               dev_err(&pdev->dev, "Can't get 'adc' clock\n");
> > -                       return ret;
> > -               }
> > +               if (ret != -ENOENT)
> > +                       return dev_err_probe(&pdev->dev, ret, "Can't get 'adc' clock\n");
> > +
> >                 priv->aclk = NULL;
> >         }
> >
> >         priv->bclk = devm_clk_get(&pdev->dev, "bus");
> >         if (IS_ERR(priv->bclk)) {
> >                 ret = PTR_ERR(priv->bclk);
> > -               if (ret != -ENOENT) {
> > -                       if (ret != -EPROBE_DEFER)
> > -                               dev_err(&pdev->dev, "Can't get 'bus' clock\n");
> > -                       return ret;
> > -               }
> > +               if (ret != -ENOENT)
> > +                       return dev_err_probe(&pdev->dev, ret, "Can't get 'bus' clock\n");
> > +
> >                 priv->bclk = NULL;
> >         }
> 
> Again, devm_clk_get_optional() and even, if it exists,
> devm_clk_bulk_get_optional().

Sure.

> 
> Please, revisit all patches on this topic.

I'll check them.


Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2020-08-27 19:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 16:18 [PATCH v2] iio: adc: stm32: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-08-27  8:27 ` Andy Shevchenko
2020-08-27 19:06   ` Krzysztof Kozlowski [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=20200827190652.GD6196@kozik-lap \
    --to=krzk@kernel.org \
    --cc=alexandre.torgue@st.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=etienne.carriere@st.com \
    --cc=fabrice.gasnier@st.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=pmeerw@pmeerw.net \
    /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).