diff options
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-gpio.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index d13b622419df..4c0b05852cb6 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c | |||
@@ -49,13 +49,13 @@ static void gpio_led_set(struct led_classdev *led_cdev, | |||
49 | if (led_dat->active_low) | 49 | if (led_dat->active_low) |
50 | level = !level; | 50 | level = !level; |
51 | 51 | ||
52 | /* setting GPIOs with I2C/etc requires a preemptible task context */ | 52 | /* Setting GPIOs with I2C/etc requires a task context, and we don't |
53 | * seem to have a reliable way to know if we're already in one; so | ||
54 | * let's just assume the worst. | ||
55 | */ | ||
53 | if (led_dat->can_sleep) { | 56 | if (led_dat->can_sleep) { |
54 | if (preempt_count()) { | 57 | led_dat->new_level = level; |
55 | led_dat->new_level = level; | 58 | schedule_work(&led_dat->work); |
56 | schedule_work(&led_dat->work); | ||
57 | } else | ||
58 | gpio_set_value_cansleep(led_dat->gpio, level); | ||
59 | } else | 59 | } else |
60 | gpio_set_value(led_dat->gpio, level); | 60 | gpio_set_value(led_dat->gpio, level); |
61 | } | 61 | } |