[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK5ve-+CgLNd0R6V21EFwgO-HmbV-RAixXipgxqyPKF9irOzuw@mail.gmail.com>
Date: Tue, 23 Dec 2014 11:02:46 -0800
From: Bryan Wu <cooloney@...il.com>
To: Gabriele Mazzotta <gabriele.mzt@...il.com>
Cc: "rpurdie@...ys.net" <rpurdie@...ys.net>,
Linux LED Subsystem <linux-leds@...r.kernel.org>,
lkml <linux-kernel@...r.kernel.org>,
Jacek Anaszewski <j.anaszewski@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>
Subject: Re: [PATCH] leds: Don't allow brightness values greater than max_brightness
On Tue, Dec 23, 2014 at 10:59 AM, Gabriele Mazzotta
<gabriele.mzt@...il.com> wrote:
> Since commit 4d71a4a12b13 ("leds: Add support for setting brightness in
> a synchronous way") the value passed to brightness_set() is no longer
> limited to max_brightness and can be different from the internally saved
> brightness value.
>
Good catch, I will merge this soon.
Thanks,
-Bryan
> Signed-off-by: Gabriele Mazzotta <gabriele.mzt@...il.com>
> ---
> drivers/leds/leds.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/leds/leds.h b/drivers/leds/leds.h
> index 2348dbd..79efe57 100644
> --- a/drivers/leds/leds.h
> +++ b/drivers/leds/leds.h
> @@ -20,7 +20,8 @@
> static inline void led_set_brightness_async(struct led_classdev *led_cdev,
> enum led_brightness value)
> {
> - led_cdev->brightness = min(value, led_cdev->max_brightness);
> + value = min(value, led_cdev->max_brightness);
> + led_cdev->brightness = value;
>
> if (!(led_cdev->flags & LED_SUSPENDED))
> led_cdev->brightness_set(led_cdev, value);
> --
> 2.1.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists