linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Denis Osterland-Heim <denis.osterland@diehl.com>,
	"dmurphy@ti.com" <dmurphy@ti.com>, "pavel@ucw.cz" <pavel@ucw.cz>
Cc: "linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>
Subject: Re: [PATCH v4] leds: pwm: check result of led_pwm_set() in led_pwm_add()
Date: Mon, 23 Mar 2020 22:41:52 +0100	[thread overview]
Message-ID: <e50f13f9-9d96-857f-7b1c-9ef5195be636@gmail.com> (raw)
In-Reply-To: <20200323091243.23140-1-Denis.Osterland@diehl.com>

Hi Denis,

Now it is better, it is:
Content-Transfer-Encoding: quoted-printable.

Nonetheless there are still some problems with charset.
See e.g. the line:

"if (ret =3D=3D 0) "

Are you using git send-email for sending patches?
I suspect not since patches arrive unordered by the
position in the patch set.

Best regards,
Jacek Anaszewski


On 3/23/20 10:14 AM, Denis Osterland-Heim wrote:
> led_pwm_set() now returns an error when setting the PWM fails.
> 
> Signed-off-by: Denis Osterland-Heim <Denis.Osterland@diehl.com>
> ---
>  drivers/leds/leds-pwm.c | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
> index 6caf8bea8cd5..07eab2d8b7c7 100644
> --- a/drivers/leds/leds-pwm.c
> +++ b/drivers/leds/leds-pwm.c
> @@ -91,15 +91,21 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
>  	pwm_init_state(led_data->pwm, &led_data->pwmstate);
>  
>  	ret = devm_led_classdev_register(dev, &led_data->cdev);
> -	if (ret == 0) {
> -		priv->num_leds++;
> -		led_pwm_set(&led_data->cdev, led_data->cdev.brightness);
> -	} else {
> +	if (ret) {
>  		dev_err(dev, "failed to register PWM led for %s: %d\n",
>  			led->name, ret);
> +		return ret;
>  	}
>  
> -	return ret;
> +	ret = led_pwm_set(&led_data->cdev, led_data->cdev.brightness);
> +	if (ret) {
> +		dev_err(dev, "failed to set led PWM value for %s: %d",
> +			led->name, ret);
> +		return ret;
> +	}
> +
> +	priv->num_leds++;
> +	return 0;
>  }
>  
>  static int led_pwm_create_fwnode(struct device *dev, struct led_pwm_priv *priv)
> 


  reply	other threads:[~2020-03-23 21:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23  9:14 [PATCH v4] leds: pwm: check result of led_pwm_set() in led_pwm_add() Denis Osterland-Heim
2020-03-23 21:41 ` Jacek Anaszewski [this message]
2020-03-24  7:36   ` Denis Osterland-Heim
2020-04-06  5:19 ` Denis Osterland-Heim
2020-03-23 15:27 Denis Osterland-Heim

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=e50f13f9-9d96-857f-7b1c-9ef5195be636@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=denis.osterland@diehl.com \
    --cc=dmurphy@ti.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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).