[ARM] 4851/1: ns9xxx: fix size of gpiores
authorUwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Thu, 6 Mar 2008 15:21:42 +0000 (16:21 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 8 Mar 2008 15:53:45 +0000 (15:53 +0000)
GPIO_MAX is the number of the last gpio, not the number of gpios.  So
the bitmap must provide GPIO_MAX + 1 bits.

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-ns9xxx/gpio.c

index b223021..5286e9f 100644 (file)
@@ -31,7 +31,7 @@
 static spinlock_t gpio_lock = __SPIN_LOCK_UNLOCKED(gpio_lock);
 
 /* only access gpiores with atomic ops */
-static DECLARE_BITMAP(gpiores, GPIO_MAX);
+static DECLARE_BITMAP(gpiores, GPIO_MAX + 1);
 
 static inline int ns9xxx_valid_gpio(unsigned gpio)
 {