pinctrl: rza1: fix error handling
Subsystems (2)
PATCH 1/1 pinctrl: rza1: fix error handling
A compiler warning points out a typo:
drivers/pinctrl/pinctrl-rza1.c: In function 'rza1_pinctrl_probe':drivers/pinctrl/pinctrl-rza1.c:1260:5: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
This changes the condition to the usual check for failure of the previous function call.
--- drivers/pinctrl/pinctrl-rza1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-rza1.c +1 -1
@@ -1257,7 +1257,7 @@ static int rza1_pinctrl_probe(struct platform_device *pdev) rza1_pctl->dev = &pdev->dev; res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (ret) +if (!res)return -ENODEV ; rza1_pctl->base =devm_ioremap_resource (&pdev->dev, res);
Signature · 1 line
2.9.0
Hi Arnd,
Quoted 2 lines · Arnd Bergmann
A compiler warning points out a typo:
Geert already sent a fix for this
https://patchwork.kernel.org/patch/9818555/
It should have been applied already
Thanks
j
Quoted 28 lines
drivers/pinctrl/pinctrl-rza1.c: In function 'rza1_pinctrl_probe':drivers/pinctrl/pinctrl-rza1.c:1260:5: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]This changes the condition to the usual check for failure of the previous function call.
Fixes 5a49b644b307 ("pinctrl: Renesas RZ/A1 pin and gpio controller")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/pinctrl/pinctrl-rza1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pinctrl/pinctrl-rza1.c +1
-2@@ -1257,7 +1257,7 @@ static int rza1_pinctrl_probe(struct platform_device *pdev) rza1_pctl->dev = &pdev->dev; res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (ret) +if (!res)return -ENODEV ; rza1_pctl->base =devm_ioremap_resource (&pdev->dev, res); --2.9.0