Skip to content

Commit

Permalink
pinctrl: imx: Fix the logic checking if not able to find pin reg map
Browse files Browse the repository at this point in the history
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 <axel.lin@ingics.com>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Axel Lin authored and Linus Walleij committed Nov 15, 2012
1 parent 102caad commit 8d1c6ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pinctrl/pinctrl-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8d1c6ef

Please sign in to comment.