[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200321152037.GB8386@duo.ucw.cz>
Date: Sat, 21 Mar 2020 16:20:37 +0100
From: Pavel Machek <pavel@....cz>
To: Denis Osterland-Heim <denis.osterland@...hl.com>
Cc: "dmurphy@...com" <dmurphy@...com>,
"mark.rutland@....com" <mark.rutland@....com>,
"jacek.anaszewski@...il.com" <jacek.anaszewski@...il.com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-leds@...r.kernel.org" <linux-leds@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"uwe@...ine-koenig.org" <uwe@...ine-koenig.org>
Subject: Re: [PATCH v4 3/5] leds: pwm: check result of led_pwm_set() in
led_pwm_add()
Hi!
> led_pwm_set() now returns an error when setting the PWM fails.
>
> Cc: Uwe Kleine-König <uwe@...ine-koenig.org>
> Signed-off-by: Denis Osterland-Heim <Denis.Osterland@...hl.com>
I applied 1 and 2, but 3 failed for me. I'll push updated -next, can
you see what is going on there?
Best regards,
Pavel
> +++ 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)
>
> The contents of the above mentioned e-mail is not legally
> binding. This e-mail contains confidential and/or legally protected
> information. Please inform us if you have received this e-mail by
This is lie. Please don't do this.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)
Powered by blists - more mailing lists