diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2019-03-01 08:53:35 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-03-01 09:08:55 +0100 |
commit | e226e3c33ab0562784a22870858eb5551d780ce7 (patch) | |
tree | e92c73346f6f824c68ced488f07f50b12287ba09 /drivers | |
parent | c0162a49e0a0651625f0c22fd45ece4573143a67 (diff) |
gpio: amd-fch: Fix type error found by sparse
Sparse complains:
gpio-amd-fch.c:45:27: sparse: expected void *
gpio-amd-fch.c:45:27: sparse: got void [noderef] <asn:2> *
gpio-amd-fch.c:45:27: sparse: warning: incorrect type in return
expression (different address spaces)
gpio-amd-fch.c:56:9: sparse: expected void const volatile [noderef]
<asn:2> *addr
gpio-amd-fch.c:56:9: sparse: expected void volatile [noderef] <asn:2> *addr
gpio-amd-fch.c:56:9: sparse: got void *ptr
gpio-amd-fch.c:56:9: sparse: warning: incorrect type in argument 1 (different address spaces)
I think it is because void * is returned rather than void __iomem *,
so fix it up.
Cc: Enrico Weigelt <info@metux.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/gpio-amd-fch.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpio/gpio-amd-fch.c b/drivers/gpio/gpio-amd-fch.c index 4fd66444ea33..4c585d4e7e74 100644 --- a/drivers/gpio/gpio-amd-fch.c +++ b/drivers/gpio/gpio-amd-fch.c @@ -39,8 +39,8 @@ struct amd_fch_gpio_priv { spinlock_t lock; }; -static void *amd_fch_gpio_addr(struct amd_fch_gpio_priv *priv, - unsigned int gpio) +static void __iomem *amd_fch_gpio_addr(struct amd_fch_gpio_priv *priv, + unsigned int gpio) { return priv->base + priv->pdata->gpio_reg[gpio]*sizeof(u32); } @@ -50,7 +50,7 @@ static int amd_fch_gpio_direction_input(struct gpio_chip *gc, { unsigned long flags; struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc); - void *ptr = amd_fch_gpio_addr(priv, offset); + void __iomem *ptr = amd_fch_gpio_addr(priv, offset); spin_lock_irqsave(&priv->lock, flags); writel_relaxed(readl_relaxed(ptr) & ~AMD_FCH_GPIO_FLAG_DIRECTION, ptr); @@ -64,7 +64,7 @@ static int amd_fch_gpio_direction_output(struct gpio_chip *gc, { unsigned long flags; struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc); - void *ptr = amd_fch_gpio_addr(priv, gpio); + void __iomem *ptr = amd_fch_gpio_addr(priv, gpio); spin_lock_irqsave(&priv->lock, flags); writel_relaxed(readl_relaxed(ptr) | AMD_FCH_GPIO_FLAG_DIRECTION, ptr); @@ -78,7 +78,7 @@ static int amd_fch_gpio_get_direction(struct gpio_chip *gc, unsigned int gpio) int ret; unsigned long flags; struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc); - void *ptr = amd_fch_gpio_addr(priv, gpio); + void __iomem *ptr = amd_fch_gpio_addr(priv, gpio); spin_lock_irqsave(&priv->lock, flags); ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_DIRECTION); @@ -92,7 +92,7 @@ static void amd_fch_gpio_set(struct gpio_chip *gc, { unsigned long flags; struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc); - void *ptr = amd_fch_gpio_addr(priv, gpio); + void __iomem *ptr = amd_fch_gpio_addr(priv, gpio); u32 mask; spin_lock_irqsave(&priv->lock, flags); @@ -113,7 +113,7 @@ static int amd_fch_gpio_get(struct gpio_chip *gc, unsigned long flags; int ret; struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc); - void *ptr = amd_fch_gpio_addr(priv, offset); + void __iomem *ptr = amd_fch_gpio_addr(priv, offset); spin_lock_irqsave(&priv->lock, flags); ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_READ); |