[brcm63xx] prevent gpio-buttons registration failure
authorFlorian Fainelli <florian@openwrt.org>
Tue, 8 Sep 2009 15:24:06 +0000 (15:24 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Tue, 8 Sep 2009 15:24:06 +0000 (15:24 +0000)
SVN-Revision: 17542

target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/board_bcm963xx.c

index b0497767cdb76fa730af25f6579574baf4034137..5f215160964a8140d7ea45c6230012db60d636be 100644 (file)
@@ -881,10 +881,12 @@ int __init board_register_devices(void)
 
        platform_device_register(&bcm63xx_gpio_leds);
 
-       bcm63xx_gpio_buttons_data.nbuttons = 1,
-       bcm63xx_gpio_buttons_data.buttons = board.reset_btn;
+       if (board.reset_btn) {
+               bcm63xx_gpio_buttons_data.nbuttons = 1,
+               bcm63xx_gpio_buttons_data.buttons = board.reset_btn;
 
-       platform_device_register(&bcm63xx_gpio_buttons_device);
+               platform_device_register(&bcm63xx_gpio_buttons_device);
+       }
 
        return 0;
 }