fix typo
[openwrt.git] / target / linux / adm5120 / patches-2.6.25 / 203-gpio_leds_brightness.patch
1 Index: linux-2.6.25.4/drivers/leds/leds-gpio.c
2 ===================================================================
3 --- linux-2.6.25.4.orig/drivers/leds/leds-gpio.c
4 +++ linux-2.6.25.4/drivers/leds/leds-gpio.c
5 @@ -41,13 +41,17 @@ static void gpio_led_set(struct led_clas
6 container_of(led_cdev, struct gpio_led_data, cdev);
7 int level;
8
9 - if (value == LED_OFF)
10 - level = 0;
11 - else
12 - level = 1;
13 -
14 - if (led_dat->active_low)
15 - level = !level;
16 + switch (value) {
17 + case LED_OFF:
18 + level = led_dat->active_low ? 1 : 0;
19 + break;
20 + case LED_FULL:
21 + level = led_dat->active_low ? 0 : 1;
22 + break;
23 + default:
24 + level = value;
25 + break;
26 + }
27
28 /* Setting GPIOs with I2C/etc requires a task context, and we don't
29 * seem to have a reliable way to know if we're already in one; so
This page took 0.047516 seconds and 5 git commands to generate.