Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87964
b: refs/heads/master
c: 306dd85
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Richard Purdie committed Mar 31, 2008
1 parent fc62148 commit 5e50245
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d95cbe6158a679d50e03787bb1dc21ff73dac372
refs/heads/master: 306dd85c1d41e20a07d1e821e27f5df4927bb5e7
12 changes: 6 additions & 6 deletions trunk/drivers/leds/leds-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ static void gpio_led_set(struct led_classdev *led_cdev,
if (led_dat->active_low)
level = !level;

/* setting GPIOs with I2C/etc requires a preemptible task context */
/* Setting GPIOs with I2C/etc requires a task context, and we don't
* seem to have a reliable way to know if we're already in one; so
* let's just assume the worst.
*/
if (led_dat->can_sleep) {
if (preempt_count()) {
led_dat->new_level = level;
schedule_work(&led_dat->work);
} else
gpio_set_value_cansleep(led_dat->gpio, level);
led_dat->new_level = level;
schedule_work(&led_dat->work);
} else
gpio_set_value(led_dat->gpio, level);
}
Expand Down

0 comments on commit 5e50245

Please sign in to comment.