-+ if (board.reset_buttons) {
-+ bcm63xx_gpio_buttons_data.nbuttons = ARRAY_SIZE(board.reset_buttons);
-+ bcm63xx_gpio_buttons_data.buttons = board.reset_buttons;
++ /* count number of BUTTONs defined by this device */
++ while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc)
++ button_count++;
++
++ if (button_count) {
++ bcm63xx_gpio_buttons_data.nbuttons = button_count;
++ bcm63xx_gpio_buttons_data.buttons = board.buttons;