summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-pxa.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2015-03-02 22:30:58 +0100
committerLinus Walleij <linus.walleij@linaro.org>2015-03-09 14:41:12 +0100
commit1e970b7d6d4fb3d715a34842ec00646f4b94bd72 (patch)
tree72545b3bfd680ad2a00b7be78964cf174a780762 /drivers/gpio/gpio-pxa.c
parentgpio: dwapb: re-enable GPIO_DWAPB for arm64 (diff)
downloadlinux-1e970b7d6d4fb3d715a34842ec00646f4b94bd72.tar.xz
linux-1e970b7d6d4fb3d715a34842ec00646f4b94bd72.zip
gpio: pxa: simplify BANK_OFF macro offset calculation
The macro BANK_OFF which calculates the base offset for each GPIO port. The macro is needlessly complex and unreadable. Simplify the calculation to a simple math operation. Signed-off-by: Rob Herring <robh@kernel.org> Cc: linux-gpio@vger.kernel.org Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-pxa.c')
-rw-r--r--drivers/gpio/gpio-pxa.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index 2fdb04b6f101..cdbbcf0faf9d 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -59,8 +59,7 @@
#define GAFR_OFFSET 0x54
#define ED_MASK_OFFSET 0x9C /* GPIO edge detection for AP side */
-#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : ((n) > 5 ? 0x200 : 0x100) \
- + (((n) % 3) << 2))
+#define BANK_OFF(n) (((n) / 3) << 8) + (((n) % 3) << 2)
int pxa_last_gpio;
static int irq_base;