From 2ce2b007c5d382a4a0e18e0dc6d814783fefd1c6 Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Thu, 21 Apr 2011 09:23:00 -0700 Subject: [PATCH] --- yaml --- r: 256701 b: refs/heads/master c: d5f46247e77a63bc3bb4b3f979281e5c700c218e h: refs/heads/master i: 256699: 101e611ad203eb0d6a2f0c29375950916620b106 v: v3 --- [refs] | 2 +- trunk/drivers/gpio/gpio-omap.c | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 935ddee3cfac..9162047ac721 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bdba15db4d81940776ab96ea9f558b7388b0f7fe +refs/heads/master: d5f46247e77a63bc3bb4b3f979281e5c700c218e diff --git a/trunk/drivers/gpio/gpio-omap.c b/trunk/drivers/gpio/gpio-omap.c index 7135810a77bc..3f436c033611 100644 --- a/trunk/drivers/gpio/gpio-omap.c +++ b/trunk/drivers/gpio/gpio-omap.c @@ -54,6 +54,7 @@ struct gpio_bank { struct device *dev; bool dbck_flag; int stride; + u32 width; }; #ifdef CONFIG_ARCH_OMAP3 @@ -79,8 +80,6 @@ static struct omap3_gpio_regs gpio_context[OMAP34XX_NR_GPIOS]; */ static struct gpio_bank *gpio_bank; -static int bank_width; - /* TODO: Analyze removing gpio_bank_count usage from driver code */ int gpio_bank_count; @@ -870,7 +869,7 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable) if (bank->non_wakeup_gpios & (1 << gpio)) { printk(KERN_ERR "Unable to modify wakeup on " "non-wakeup GPIO%d\n", - (bank - gpio_bank) * 32 + gpio); + (bank - gpio_bank) * bank->width + gpio); return -EINVAL; } spin_lock_irqsave(&bank->lock, flags); @@ -1545,14 +1544,14 @@ static void __devinit omap_gpio_chip_init(struct gpio_bank *bank) } else { bank->chip.label = "gpio"; bank->chip.base = gpio; - gpio += bank_width; + gpio += bank->width; } - bank->chip.ngpio = bank_width; + bank->chip.ngpio = bank->width; gpiochip_add(&bank->chip); for (j = bank->virtual_irq_start; - j < bank->virtual_irq_start + bank_width; j++) { + j < bank->virtual_irq_start + bank->width; j++) { irq_set_lockdep_class(j, &gpio_lock_class); irq_set_chip_data(j, bank); if (bank_is_mpuio(bank)) @@ -1602,7 +1601,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev) bank->dev = &pdev->dev; bank->dbck_flag = pdata->dbck_flag; bank->stride = pdata->bank_stride; - bank_width = pdata->bank_width; + bank->width = pdata->bank_width; spin_lock_init(&bank->lock);