Commit 64c8cbc1 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: default avatarDavid Cohen <david.a.cohen@intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent aeb168f7
...@@ -65,7 +65,7 @@ enum GPIO_REG { ...@@ -65,7 +65,7 @@ enum GPIO_REG {
struct lnw_gpio { struct lnw_gpio {
struct gpio_chip chip; struct gpio_chip chip;
void *reg_base; void __iomem *reg_base;
spinlock_t lock; spinlock_t lock;
struct pci_dev *pdev; struct pci_dev *pdev;
struct irq_domain *domain; struct irq_domain *domain;
...@@ -318,9 +318,9 @@ static const struct dev_pm_ops lnw_gpio_pm_ops = { ...@@ -318,9 +318,9 @@ static const struct dev_pm_ops lnw_gpio_pm_ops = {
}; };
static int lnw_gpio_probe(struct pci_dev *pdev, static int lnw_gpio_probe(struct pci_dev *pdev,
const struct pci_device_id *id) const struct pci_device_id *id)
{ {
void *base; void __iomem *base;
resource_size_t start, len; resource_size_t start, len;
struct lnw_gpio *lnw; struct lnw_gpio *lnw;
u32 gpio_base; u32 gpio_base;
...@@ -346,8 +346,10 @@ static int lnw_gpio_probe(struct pci_dev *pdev, ...@@ -346,8 +346,10 @@ static int lnw_gpio_probe(struct pci_dev *pdev,
retval = -EFAULT; retval = -EFAULT;
goto err_ioremap; goto err_ioremap;
} }
irq_base = *(u32 *)base;
gpio_base = *((u32 *)base + 1); irq_base = readl(base);
gpio_base = readl(sizeof(u32) + base);
/* release the IO mapping, since we already get the info from bar1 */ /* release the IO mapping, since we already get the info from bar1 */
iounmap(base); iounmap(base);
/* get the register base from bar0 */ /* get the register base from bar0 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment