Skip to content

Commit 376c7a7

Browse files
masahir0yLinus Walleij
authored andcommitted
pinctrl: nomadik: fix incorrect type in return expression
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> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent d52e0d0 commit 376c7a7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/pinctrl/nomadik/pinctrl-nomadik.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ static struct nmk_gpio_chip *nmk_gpio_populate_chip(struct device_node *np,
10781078
res = platform_get_resource(gpio_pdev, IORESOURCE_MEM, 0);
10791079
base = devm_ioremap_resource(&pdev->dev, res);
10801080
if (IS_ERR(base))
1081-
return base;
1081+
return ERR_CAST(base);
10821082
nmk_chip->addr = base;
10831083

10841084
clk = clk_get(&gpio_pdev->dev, NULL);

0 commit comments

Comments
 (0)