From 8d1c6ef67a4530ee5dbd5038d2959a54593013b1 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 13 Nov 2012 09:00:07 +0800 Subject: [PATCH] pinctrl: imx: Fix the logic checking if not able to find pin reg map Current code sets "pin_reg = &info->pin_regs[i];" in each loop iteration, so in the case of no-match, pin_reg is not NULL. Signed-off-by: Axel Lin Acked-by: Dong Aisheng Signed-off-by: Linus Walleij --- drivers/pinctrl/pinctrl-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-imx.c b/drivers/pinctrl/pinctrl-imx.c index f3d2384b34b..525a2c8644f 100644 --- a/drivers/pinctrl/pinctrl-imx.c +++ b/drivers/pinctrl/pinctrl-imx.c @@ -71,7 +71,7 @@ static const struct imx_pin_reg *imx_find_pin_reg( break; } - if (!pin_reg) { + if (i == info->npin_regs) { dev_err(info->dev, "Pin(%s): unable to find pin reg map\n", info->pins[pin].name); return NULL; -- 2.46.0