| 1 | --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c |
| 2 | +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c |
| 3 | @@ -862,6 +862,7 @@ static struct platform_device bcm63xx_gp |
| 4 | int __init board_register_devices(void) |
| 5 | { |
| 6 | int button_count = 0; |
| 7 | + int led_count = 0; |
| 8 | |
| 9 | if (board.has_uart0) |
| 10 | bcm63xx_uart_register(0); |
| 11 | @@ -900,10 +901,16 @@ int __init board_register_devices(void) |
| 12 | |
| 13 | bcm63xx_flash_register(); |
| 14 | |
| 15 | - bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds); |
| 16 | - bcm63xx_led_data.leds = board.leds; |
| 17 | + /* count number of LEDs defined by this device */ |
| 18 | + while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name) |
| 19 | + led_count++; |
| 20 | + |
| 21 | + if (led_count) { |
| 22 | + bcm63xx_led_data.num_leds = led_count; |
| 23 | + bcm63xx_led_data.leds = board.leds; |
| 24 | |
| 25 | - platform_device_register(&bcm63xx_gpio_leds); |
| 26 | + platform_device_register(&bcm63xx_gpio_leds); |
| 27 | + } |
| 28 | |
| 29 | /* count number of BUTTONs defined by this device */ |
| 30 | while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc) |
| 31 | --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h |
| 32 | +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h |
| 33 | @@ -57,7 +57,7 @@ struct board_info { |
| 34 | struct bcm63xx_dsp_platform_data dsp; |
| 35 | |
| 36 | /* GPIO LEDs */ |
| 37 | - struct gpio_led leds[5]; |
| 38 | + struct gpio_led leds[14]; |
| 39 | |
| 40 | /* Buttons */ |
| 41 | struct gpio_keys_button buttons[4]; |
| 42 | |