Re: [PATCH 1/2] leds: use workqueue in led_set_brightness() API internally

From: Shuah Khan
Date: Fri Sep 14 2012 - 18:24:56 EST


On Fri, Sep 14, 2012 at 1:53 AM, Bryan Wu <bryan.wu@xxxxxxxxxxxxx> wrote:
> The API function led_set_brightness() and __led_set_brightness will
> call .brightness_set() function provided by led class drivers. So
> .brightness_set() function will run in atomic context, which requires
> led class drivers use workqueue in .brightness_set().
>
> Finally, all the led class driver implemented their own workqueue in
> .brightness_set(). For those missing this, we will face runtime warning
> or error when running it in atomic context.
>
> This patch adds a workqueue in led_set_brightness() internally. LED
> class driver doesn't need to care about duplicated workqueue stuff in
> their own driver.
>
> Also this patch unified the led_set_brightness() and __led_set_brightness()
>
> Signed-off-by: Bryan Wu <bryan.wu@xxxxxxxxxxxxx>
> ---
> drivers/leds/led-class.c | 23 ++++++++++++-----------
> drivers/leds/led-core.c | 15 +++++++--------
> drivers/leds/leds.h | 11 ++---------
> drivers/leds/ledtrig-backlight.c | 8 ++++----
> drivers/leds/ledtrig-default-on.c | 2 +-
> drivers/leds/ledtrig-gpio.c | 6 +++---
> drivers/leds/ledtrig-heartbeat.c | 2 +-
> drivers/leds/ledtrig-oneshot.c | 4 ++--
> drivers/leds/ledtrig-transient.c | 8 ++++----

Bryan,

ledtrig-transient.c change looks good. Thanks for updating it.

-- Shuah
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/