1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -331,29 +331,28 @@ static struct board_info __initdata boar
33 - .default_trigger = "default-on",
43 @@ -855,6 +854,7 @@ static struct platform_device bcm63xx_gp
44 int __init board_register_devices(void)
51 @@ -902,7 +902,11 @@ int __init board_register_devices(void)
53 platform_device_register_simple("GPIODEV", 0, &gpiodev_resource, 1);
55 - bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds);
56 + /* count number of LEDs defined by this device */
57 + while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name)
60 + bcm63xx_led_data.num_leds = led_count;
61 bcm63xx_led_data.leds = board.leds;
63 platform_device_register(&bcm63xx_gpio_leds);