[brcm63xx] patches: Renamed 150-led_count to 141-led_count so it comes before the...
[15.05/openwrt.git] / target / linux / brcm63xx / patches-2.6.35 / 141-led_count.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -881,6 +881,7 @@ int __init board_register_devices(void)
4  {
5         u32 val;
6         int button_count = 0;
7 +       int led_count = 0;
8  
9         if (board.has_uart0)
10                 bcm63xx_uart_register(0);
11 @@ -922,7 +923,11 @@ int __init board_register_devices(void)
12  
13         platform_device_register_simple("GPIODEV", 0, &gpiodev_resource, 1);
14  
15 -       bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds);
16 +       /* count number of LEDs defined by this device */
17 +       while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name)
18 +         led_count++;
19 +
20 +       bcm63xx_led_data.num_leds = led_count;
21         bcm63xx_led_data.leds = board.leds;
22  
23         platform_device_register(&bcm63xx_gpio_leds);