aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-nomadik.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-04-17 04:15:54 -0400
committerLinus Walleij <linus.walleij@linaro.org>2012-04-24 03:36:04 -0400
commit8d91771ca4aff257f53ac7643f90b5cbb740971b (patch)
tree991fc0ffa84d0ea9378ecb6e4542032e081046c6 /drivers/gpio/gpio-nomadik.c
parentebc6178dab43b38042f0e089526bad49081870e5 (diff)
gpio/nomadik: use ioremap() instead of static mappings
We were using a custom io_p2v() (physical-to-virtual) translation macro, but it's fully possible to just ioremap() this memory now, so skip use of static addresses altogether. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-nomadik.c')
-rw-r--r--drivers/gpio/gpio-nomadik.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.c
index 7b45d88b4f44..b35eb25209ec 100644
--- a/drivers/gpio/gpio-nomadik.c
+++ b/drivers/gpio/gpio-nomadik.c
@@ -28,8 +28,6 @@
28 28
29#include <plat/pincfg.h> 29#include <plat/pincfg.h>
30#include <plat/gpio-nomadik.h> 30#include <plat/gpio-nomadik.h>
31#include <mach/hardware.h>
32#include <asm/gpio.h>
33 31
34/* 32/*
35 * The GPIO module in the Nomadik family of Systems-on-Chip is an 33 * The GPIO module in the Nomadik family of Systems-on-Chip is an
@@ -1139,6 +1137,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
1139 struct resource *res; 1137 struct resource *res;
1140 struct clk *clk; 1138 struct clk *clk;
1141 int secondary_irq; 1139 int secondary_irq;
1140 void __iomem *base;
1142 int irq; 1141 int irq;
1143 int ret; 1142 int ret;
1144 1143
@@ -1169,10 +1168,16 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
1169 goto out; 1168 goto out;
1170 } 1169 }
1171 1170
1171 base = ioremap(res->start, resource_size(res));
1172 if (!base) {
1173 ret = -ENOMEM;
1174 goto out_release;
1175 }
1176
1172 clk = clk_get(&dev->dev, NULL); 1177 clk = clk_get(&dev->dev, NULL);
1173 if (IS_ERR(clk)) { 1178 if (IS_ERR(clk)) {
1174 ret = PTR_ERR(clk); 1179 ret = PTR_ERR(clk);
1175 goto out_release; 1180 goto out_unmap;
1176 } 1181 }
1177 1182
1178 nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL); 1183 nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL);
@@ -1186,7 +1191,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
1186 */ 1191 */
1187 nmk_chip->bank = dev->id; 1192 nmk_chip->bank = dev->id;
1188 nmk_chip->clk = clk; 1193 nmk_chip->clk = clk;
1189 nmk_chip->addr = io_p2v(res->start); 1194 nmk_chip->addr = base;
1190 nmk_chip->chip = nmk_gpio_template; 1195 nmk_chip->chip = nmk_gpio_template;
1191 nmk_chip->parent_irq = irq; 1196 nmk_chip->parent_irq = irq;
1192 nmk_chip->secondary_parent_irq = secondary_irq; 1197 nmk_chip->secondary_parent_irq = secondary_irq;
@@ -1226,6 +1231,8 @@ out_free:
1226out_clk: 1231out_clk:
1227 clk_disable(clk); 1232 clk_disable(clk);
1228 clk_put(clk); 1233 clk_put(clk);
1234out_unmap:
1235 iounmap(base);
1229out_release: 1236out_release:
1230 release_mem_region(res->start, resource_size(res)); 1237 release_mem_region(res->start, resource_size(res));
1231out: 1238out: