aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpio/gpio-langwell.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c
index 313d190c528d..fec85ca89c58 100644
--- a/drivers/gpio/gpio-langwell.c
+++ b/drivers/gpio/gpio-langwell.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Moorestown platform Langwell chip GPIO driver 2 * Moorestown platform Langwell chip GPIO driver
3 * 3 *
4 * Copyright (c) 2008 - 2009, Intel Corporation. 4 * Copyright (c) 2008, 2009, 2013, Intel Corporation.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
@@ -74,15 +74,13 @@ struct lnw_gpio {
74#define to_lnw_priv(chip) container_of(chip, struct lnw_gpio, chip) 74#define to_lnw_priv(chip) container_of(chip, struct lnw_gpio, chip)
75 75
76static void __iomem *gpio_reg(struct gpio_chip *chip, unsigned offset, 76static void __iomem *gpio_reg(struct gpio_chip *chip, unsigned offset,
77 enum GPIO_REG reg_type) 77 enum GPIO_REG reg_type)
78{ 78{
79 struct lnw_gpio *lnw = to_lnw_priv(chip); 79 struct lnw_gpio *lnw = to_lnw_priv(chip);
80 unsigned nreg = chip->ngpio / 32; 80 unsigned nreg = chip->ngpio / 32;
81 u8 reg = offset / 32; 81 u8 reg = offset / 32;
82 void __iomem *ptr;
83 82
84 ptr = (void __iomem *)(lnw->reg_base + reg_type * nreg * 4 + reg * 4); 83 return lnw->reg_base + reg_type * nreg * 4 + reg * 4;
85 return ptr;
86} 84}
87 85
88static void __iomem *gpio_reg_2bit(struct gpio_chip *chip, unsigned offset, 86static void __iomem *gpio_reg_2bit(struct gpio_chip *chip, unsigned offset,
@@ -91,10 +89,8 @@ static void __iomem *gpio_reg_2bit(struct gpio_chip *chip, unsigned offset,
91 struct lnw_gpio *lnw = to_lnw_priv(chip); 89 struct lnw_gpio *lnw = to_lnw_priv(chip);
92 unsigned nreg = chip->ngpio / 32; 90 unsigned nreg = chip->ngpio / 32;
93 u8 reg = offset / 16; 91 u8 reg = offset / 16;
94 void __iomem *ptr;
95 92
96 ptr = (void __iomem *)(lnw->reg_base + reg_type * nreg * 4 + reg * 4); 93 return lnw->reg_base + reg_type * nreg * 4 + reg * 4;
97 return ptr;
98} 94}
99 95
100static int lnw_gpio_request(struct gpio_chip *chip, unsigned offset) 96static int lnw_gpio_request(struct gpio_chip *chip, unsigned offset)