All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Jerome Brunet <jbrunet@baylibre.com>, sre@kernel.org
Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] leds: pwm: silently error out on EPROBE_DEFER
Date: Thu, 6 Sep 2018 17:35:48 +0200	[thread overview]
Message-ID: <20180906153548.GA10088@amd> (raw)
In-Reply-To: <20180906135904.13803-1-jbrunet@baylibre.com>

[-- Attachment #1: Type: text/plain, Size: 1252 bytes --]

On Thu 2018-09-06 15:59:04, Jerome Brunet wrote:
> When probing, if we fail to get the pwm due to probe deferal, we shouldn't
> print an error message. Just be silent in this case.
> 
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  drivers/leds/leds-pwm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
> index df80c89ebe7f..5d3faae51d59 100644
> --- a/drivers/leds/leds-pwm.c
> +++ b/drivers/leds/leds-pwm.c
> @@ -100,8 +100,9 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
>  		led_data->pwm = devm_pwm_get(dev, led->name);
>  	if (IS_ERR(led_data->pwm)) {
>  		ret = PTR_ERR(led_data->pwm);
> -		dev_err(dev, "unable to request PWM for %s: %d\n",
> -			led->name, ret);
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(dev, "unable to request PWM for %s: %d\n",
> +				led->name, ret);
>  		return ret;
>  	}

Hmm, sometimes probing is deffered forever, and in such case debug
message is useful.

Do you see excessive number of these?
									
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2018-09-06 15:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06 13:59 [PATCH] leds: pwm: silently error out on EPROBE_DEFER Jerome Brunet
2018-09-06 15:35 ` Pavel Machek [this message]
2018-09-07  7:56   ` Jerome Brunet
2018-09-08 20:49 ` Jacek Anaszewski

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=20180906153548.GA10088@amd \
    --to=pavel@ucw.cz \
    --cc=jacek.anaszewski@gmail.com \
    --cc=jbrunet@baylibre.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=sre@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.