aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-2.6.33/100-reset_buttons.patch
diff options
context:
space:
mode:
authorRaphaël Huck <rhk@cksum.org>2010-04-29 12:50:09 +0000
committerRaphaël Huck <rhk@cksum.org>2010-04-29 12:50:09 +0000
commit5af6e7724b53fbb6acaa13ab386645bfc595e891 (patch)
treecf01777ae39241ee0fb3485a17fb759495e77c21 /target/linux/brcm63xx/patches-2.6.33/100-reset_buttons.patch
parent36ee230fcaa1f1280045f54ce679db9790f0828d (diff)
downloadupstream-5af6e7724b53fbb6acaa13ab386645bfc595e891.tar.gz
upstream-5af6e7724b53fbb6acaa13ab386645bfc595e891.tar.bz2
upstream-5af6e7724b53fbb6acaa13ab386645bfc595e891.zip
fix gpio_button device register
SVN-Revision: 21252
Diffstat (limited to 'target/linux/brcm63xx/patches-2.6.33/100-reset_buttons.patch')
-rw-r--r--target/linux/brcm63xx/patches-2.6.33/100-reset_buttons.patch19
1 files changed, 15 insertions, 4 deletions
diff --git a/target/linux/brcm63xx/patches-2.6.33/100-reset_buttons.patch b/target/linux/brcm63xx/patches-2.6.33/100-reset_buttons.patch
index e1faeeedaf..292e0a7cc9 100644
--- a/target/linux/brcm63xx/patches-2.6.33/100-reset_buttons.patch
+++ b/target/linux/brcm63xx/patches-2.6.33/100-reset_buttons.patch
@@ -43,7 +43,7 @@
};
static struct board_info __initdata board_FAST2404 = {
-@@ -770,6 +792,16 @@ static struct platform_device bcm63xx_gp
+@@ -770,12 +792,23 @@ static struct platform_device bcm63xx_gp
.dev.platform_data = &bcm63xx_led_data,
};
@@ -60,12 +60,23 @@
/*
* third stage init callback, register all board devices.
*/
-@@ -825,6 +857,13 @@ int __init board_register_devices(void)
+ int __init board_register_devices(void)
+ {
+ u32 val;
++ int button_count = 0;
+
+ if (board.has_pccard)
+ bcm63xx_pcmcia_register();
+@@ -825,6 +858,17 @@ int __init board_register_devices(void)
platform_device_register(&bcm63xx_gpio_leds);
-+ if (board.reset_buttons) {
-+ bcm63xx_gpio_buttons_data.nbuttons = ARRAY_SIZE(board.reset_buttons);
++ /* count number of BUTTONs defined by this device */
++ while (button_count < ARRAY_SIZE(board.reset_buttons) && board.reset_buttons[button_count].desc)
++ button_count++;
++
++ if (button_count) {
++ bcm63xx_gpio_buttons_data.nbuttons = button_count;
+ bcm63xx_gpio_buttons_data.buttons = board.reset_buttons;
+
+ platform_device_register(&bcm63xx_gpio_buttons_device);