Skip to content

Commit

Permalink
Subject: pinctrl: imx1-core: Fix debug output in .pin_config_set call…
Browse files Browse the repository at this point in the history
…back

imx1_pinconf_set assumes that the array of pins in struct
imx1_pinctrl_soc_info can be indexed by pin id to get the
pinctrl_pin_desc for a pin. This used to be correct up to commit
607af16 which removed some entries from the array and so made it
wrong to access the array by pin id.

The result of this bug is a wrong pin name in the output for small pin
ids and an oops for the bigger ones.

This patch is the result of a discussion that includes patches by Markus
Pargmann and Chris Ruehl.

Fixes: 607af16 ("pinctrl: i.MX27: Remove nonexistent pad definitions")
Cc: stable@vger.kernel.org
Reported-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Uwe Kleine-König authored and Linus Walleij committed Jul 20, 2015
1 parent 714b1dd commit 9571b25
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/pinctrl/freescale/pinctrl-imx1-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,13 @@ static int imx1_pinconf_set(struct pinctrl_dev *pctldev,
unsigned num_configs)
{
struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
const struct imx1_pinctrl_soc_info *info = ipctl->info;
int i;

for (i = 0; i != num_configs; ++i) {
imx1_write_bit(ipctl, pin_id, configs[i] & 0x01, MX1_PUEN);

dev_dbg(ipctl->dev, "pinconf set pullup pin %s\n",
info->pins[pin_id].name);
pin_desc_get(pctldev, pin_id)->name);
}

return 0;
Expand Down

0 comments on commit 9571b25

Please sign in to comment.