From ea4083165fbb322b69a59588a283b7c98bd42db3 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 30 Jun 2017 08:57:39 +0200 Subject: [PATCH] pinctrl: rza1: Remove unneeded wrong check for wrong variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Depending on compiler version: drivers/pinctrl/pinctrl-rza1.c: In function ‘rza1_pinctrl_probe’: drivers/pinctrl/pinctrl-rza1.c:1260:5: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (ret) ^ Indeed, the result returned by platform_get_resource() was stored in "res", not "ret". In addition, the correct error check would be "if (!res)", as platform_get_resource() does not return an error code, but returns NULL on failure. However, as devm_ioremap_resource() verifies the validity of the passed resource pointer anyway, the check can just be removed. Reported-by: Stephen Rothwell Fixes: 5a49b644b3075f88 ("pinctrl: Renesas RZ/A1 pin and gpio controller") Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Walleij --- drivers/pinctrl/pinctrl-rza1.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rza1.c b/drivers/pinctrl/pinctrl-rza1.c index 614a043f3038..1188e6881e52 100644 --- a/drivers/pinctrl/pinctrl-rza1.c +++ b/drivers/pinctrl/pinctrl-rza1.c @@ -1257,9 +1257,6 @@ static int rza1_pinctrl_probe(struct platform_device *pdev) rza1_pctl->dev = &pdev->dev; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (ret) - return -ENODEV; - rza1_pctl->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(rza1_pctl->base)) return PTR_ERR(rza1_pctl->base); -- 2.45.2