linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Chen-Yu Tsai <wens@csie.org>,
	David Lechner <david@lechnology.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Ludovic Desroches <ludovic.desroches@microchip.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Maxime Ripard <mripard@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Sekhar Nori <nsekhar@ti.com>,
	linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 04/10] clk: gpio: Simplify with dev_err_probe()
Date: Fri, 11 Sep 2020 17:29:43 +0200	[thread overview]
Message-ID: <20200911152943.GA17780@kozik-lap> (raw)
In-Reply-To: <159977526650.2295844.8933765686946237404@swboyd.mtv.corp.google.com>

On Thu, Sep 10, 2020 at 03:01:06PM -0700, Stephen Boyd wrote:
> Quoting Krzysztof Kozlowski (2020-09-02 08:03:42)
> > diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c
> > index 38755a241ab7..a3cc53edcb11 100644
> > --- a/drivers/clk/clk-gpio.c
> > +++ b/drivers/clk/clk-gpio.c
> > @@ -211,17 +210,10 @@ static int gpio_clk_driver_probe(struct platform_device *pdev)
> >  
> >         gpio_name = is_mux ? "select" : "enable";
> >         gpiod = devm_gpiod_get(dev, gpio_name, GPIOD_OUT_LOW);
> > -       if (IS_ERR(gpiod)) {
> > -               ret = PTR_ERR(gpiod);
> > -               if (ret == -EPROBE_DEFER)
> > -                       pr_debug("%pOFn: %s: GPIOs not yet available, retry later\n",
> > -                                       node, __func__);
> > -               else
> > -                       pr_err("%pOFn: %s: Can't get '%s' named GPIO property\n",
> > -                                       node, __func__,
> > -                                       gpio_name);
> > -               return ret;
> > -       }
> > +       if (IS_ERR(gpiod))
> > +               return dev_err_probe(dev, PTR_ERR(gpiod),
> 
> This is cool! I wonder if we could make it even more simplified with
> 
> 	ret = dev_err_probe_ptr(dev, ptr, ...)
> 	if (ret)
> 		return ret;
> 
> then we don't have to do the PTR_ERR() or IS_ERR() dance in all the
> drivers. It could already be changed here to look at the return value of
> dev_err_probe() so please do that at the least.

I think this could be achieved with Rob's work here:
git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git dev_err-removal

It would make this patchset obsolete. Up to you then if you plan to wait
for Rob's work.


> It would also even be more super duper cool if we had a way to save some
> sort of cookie when the provider can't find it and is returning the
> -EPROBE_DEFER value. Maybe the provider could use
> device_set_deferred_probe_reason() on error and then if dev_err_probe()
> is called without any string it can print what is in the device's
> deferred probe reason? Or append to it whatever string is passed from
> the device driver? Sometimes the provider has more info like the DT
> property is malformed or the provider isn't probed yet which would
> probably help understand the deferred problem more.

Yes, good point. If all (or most) messages are moved to the providers,
it would be easier to print also the defer reasons.

Best regards,
Krzysztof


  reply	other threads:[~2020-09-11 15:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 15:03 [PATCH 01/10] clk: at91: Drop unused at91sam9g45_pcr_layout Krzysztof Kozlowski
2020-09-02 15:03 ` [PATCH 02/10] clk: fixed: Add missing kerneldoc Krzysztof Kozlowski
2020-09-02 15:03 ` [PATCH 03/10] clk: bulk: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-02 15:03 ` [PATCH 04/10] clk: gpio: " Krzysztof Kozlowski
2020-09-10 22:01   ` Stephen Boyd
2020-09-11 15:29     ` Krzysztof Kozlowski [this message]
2020-09-02 15:03 ` [PATCH 05/10] clk: sunxi-ng: " Krzysztof Kozlowski
2020-09-02 15:03 ` [PATCH 06/10] clk: keystone: " Krzysztof Kozlowski
2020-09-02 15:03 ` [PATCH 07/10] clk: meson: " Krzysztof Kozlowski
2020-09-07  8:30   ` Jerome Brunet
2020-09-02 15:03 ` [PATCH 08/10] clk: qcom: " Krzysztof Kozlowski
2020-09-02 15:03 ` [PATCH 09/10] clk: davinci: Add missing kerneldoc Krzysztof Kozlowski
2020-09-02 15:37   ` David Lechner
2020-09-02 15:03 ` [PATCH 10/10] clk: davinci: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-02 15:37   ` David Lechner
2020-09-02 16:35 ` [PATCH 01/10] clk: at91: Drop unused at91sam9g45_pcr_layout Alexandre Belloni
2020-09-11 15:34   ` Krzysztof Kozlowski
2020-09-15  0:01     ` Stephen Boyd
2020-09-16 16:15       ` Krzysztof Kozlowski

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=20200911152943.GA17780@kozik-lap \
    --to=krzk@kernel.org \
    --cc=agross@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=david@lechnology.com \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ludovic.desroches@microchip.com \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mripard@kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=narmstrong@baylibre.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=nsekhar@ti.com \
    --cc=sboyd@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=wens@csie.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).