aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2010-07-13 04:26:10 -0400
committerMike Frysinger <vapier@gentoo.org>2010-08-06 12:55:53 -0400
commit382dbe5b39a4efa6fdb3e5093e5d0bdbb5c5301f (patch)
tree083a8ed9275e2f30048ff325f9a22d3c342e37c2 /arch
parent3322c7bbf60801da2a22d7bd88865d2dc3bd73ac (diff)
Blackfin: portmux: fix peripheral map overflow when requesting pins
Some processors have groups of pins that aren't an even number of 16. This causes the array size calculation to under count the number of needed entries due to integer truncation. So on the BF51x, while we should have 3 bitmaps (41 / 16), we end up with 2 and pin requests for the 3rd bank end up scribbling over the top of the GPIO IRQ array. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index c5650559a4e1..dc07ed08b37f 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -157,7 +157,7 @@ static int cmp_label(unsigned short ident, const char *label)
157#define DECLARE_RESERVED_MAP(m, c) static unsigned short reserved_##m##_map[c] 157#define DECLARE_RESERVED_MAP(m, c) static unsigned short reserved_##m##_map[c]
158 158
159DECLARE_RESERVED_MAP(gpio, GPIO_BANK_NUM); 159DECLARE_RESERVED_MAP(gpio, GPIO_BANK_NUM);
160DECLARE_RESERVED_MAP(peri, gpio_bank(MAX_RESOURCES)); 160DECLARE_RESERVED_MAP(peri, DIV_ROUND_UP(MAX_RESOURCES, GPIO_BANKSIZE));
161DECLARE_RESERVED_MAP(gpio_irq, GPIO_BANK_NUM); 161DECLARE_RESERVED_MAP(gpio_irq, GPIO_BANK_NUM);
162 162
163inline int check_gpio(unsigned gpio) 163inline int check_gpio(unsigned gpio)