* [PATCH] pinctrl: nomadik: fix incorrect type in return expression
@ 2017-08-04 4:49 Masahiro Yamada
2017-08-07 13:14 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2017-08-04 4:49 UTC (permalink / raw)
To: linux-gpio
Cc: Masahiro Yamada, Linus Walleij, linux-arm-kernel,
Alessandro Rubini, linux-kernel
Sparse reports "warning: incorrect type in return expression (different
address spaces)" because nmk_gpio_populate_chip() is supposed to return
(struct nmk_gpio_chip *) whereas devm_ioremap_resource() returns
(void __iomem *). ERR_CAST() is needed to fix the warning.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
drivers/pinctrl/nomadik/pinctrl-nomadik.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
index d318ca055489..a53f1a9b1ed2 100644
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
@@ -1078,7 +1078,7 @@ static struct nmk_gpio_chip *nmk_gpio_populate_chip(struct device_node *np,
res = platform_get_resource(gpio_pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base))
- return base;
+ return ERR_CAST(base);
nmk_chip->addr = base;
clk = clk_get(&gpio_pdev->dev, NULL);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pinctrl: nomadik: fix incorrect type in return expression
2017-08-04 4:49 [PATCH] pinctrl: nomadik: fix incorrect type in return expression Masahiro Yamada
@ 2017-08-07 13:14 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2017-08-07 13:14 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-gpio, linux-arm-kernel, Alessandro Rubini, linux-kernel
On Fri, Aug 4, 2017 at 6:49 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Sparse reports "warning: incorrect type in return expression (different
> address spaces)" because nmk_gpio_populate_chip() is supposed to return
> (struct nmk_gpio_chip *) whereas devm_ioremap_resource() returns
> (void __iomem *). ERR_CAST() is needed to fix the warning.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-07 13:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-04 4:49 [PATCH] pinctrl: nomadik: fix incorrect type in return expression Masahiro Yamada
2017-08-07 13:14 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).