From: Tony Lindgren Date: Wed, 8 Dec 2010 00:26:56 +0000 (-0800) Subject: OMAP: GPIO: Make omap_gpio_show_rev bank specific X-Git-Tag: MMI-PSA29.97-13-9~21439^2~46^2~10 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9a748053f5f58a77cd71864f1d7b804175b0e47d;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git OMAP: GPIO: Make omap_gpio_show_rev bank specific Otherwise GPIO init on 16xx may try to access uninitialized GPIO bank as the MPUIO bank does not have a revision register. Acked-by: Kevin Hilman Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 48bccf2001eb..e4741905285b 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c @@ -1694,16 +1694,16 @@ static struct clk * gpio5_fck; static struct clk *gpio_iclks[OMAP34XX_NR_GPIOS]; #endif -static void __init omap_gpio_show_rev(void) +static void __init omap_gpio_show_rev(struct gpio_bank *bank) { u32 rev; - if (cpu_is_omap16xx()) - rev = __raw_readw(gpio_bank[1].base + OMAP1610_GPIO_REVISION); + if (cpu_is_omap16xx() && !(bank->method != METHOD_MPUIO)) + rev = __raw_readw(bank->base + OMAP1610_GPIO_REVISION); else if (cpu_is_omap24xx() || cpu_is_omap34xx()) - rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION); + rev = __raw_readl(bank->base + OMAP24XX_GPIO_REVISION); else if (cpu_is_omap44xx()) - rev = __raw_readl(gpio_bank[0].base + OMAP4_GPIO_REVISION); + rev = __raw_readl(bank->base + OMAP4_GPIO_REVISION); else return; @@ -1963,7 +1963,7 @@ static int __init _omap_gpio_init(void) } } - omap_gpio_show_rev(); + omap_gpio_show_rev(bank); return 0; }