aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-langwell.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2013-05-22 06:20:11 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-05-30 13:30:56 -0400
commit64c8cbc17c8d4af3b600c66247e47eac99e46aaf (patch)
tree7b05d727f66cb9c56bd6c0e6eb6a3dbffe52971b /drivers/gpio/gpio-langwell.c
parentaeb168f77c745fa4964e217400c9d43685e46705 (diff)
gpio-langwell: do not use direct access to iomapped memory
We better to use readl() function instead of bad looking direct access. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: David Cohen <david.a.cohen@intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-langwell.c')
-rw-r--r--drivers/gpio/gpio-langwell.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c
index a0190de14371..fff661126dc7 100644
--- a/drivers/gpio/gpio-langwell.c
+++ b/drivers/gpio/gpio-langwell.c
@@ -65,7 +65,7 @@ enum GPIO_REG {
65 65
66struct lnw_gpio { 66struct lnw_gpio {
67 struct gpio_chip chip; 67 struct gpio_chip chip;
68 void *reg_base; 68 void __iomem *reg_base;
69 spinlock_t lock; 69 spinlock_t lock;
70 struct pci_dev *pdev; 70 struct pci_dev *pdev;
71 struct irq_domain *domain; 71 struct irq_domain *domain;
@@ -318,9 +318,9 @@ static const struct dev_pm_ops lnw_gpio_pm_ops = {
318}; 318};
319 319
320static int lnw_gpio_probe(struct pci_dev *pdev, 320static int lnw_gpio_probe(struct pci_dev *pdev,
321 const struct pci_device_id *id) 321 const struct pci_device_id *id)
322{ 322{
323 void *base; 323 void __iomem *base;
324 resource_size_t start, len; 324 resource_size_t start, len;
325 struct lnw_gpio *lnw; 325 struct lnw_gpio *lnw;
326 u32 gpio_base; 326 u32 gpio_base;
@@ -346,8 +346,10 @@ static int lnw_gpio_probe(struct pci_dev *pdev,
346 retval = -EFAULT; 346 retval = -EFAULT;
347 goto err_ioremap; 347 goto err_ioremap;
348 } 348 }
349 irq_base = *(u32 *)base; 349
350 gpio_base = *((u32 *)base + 1); 350 irq_base = readl(base);
351 gpio_base = readl(sizeof(u32) + base);
352
351 /* release the IO mapping, since we already get the info from bar1 */ 353 /* release the IO mapping, since we already get the info from bar1 */
352 iounmap(base); 354 iounmap(base);
353 /* get the register base from bar0 */ 355 /* get the register base from bar0 */