Commit dd89ea7a authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Luis Henriques

pinctrl: pinctrl-imx: don't use invalid value of conf_reg

commit 4ff0f034 upstream.

The right check for conf_reg to be invalid it testing against -1 not 0
as is done in the rest of the driver.

This fixes an oops that can be triggered by:

	cat /sys/kernel/debug/pinctrl/43fac000.iomuxc/*

Fixes: ae75ff81 ("pinctrl: pinctrl-imx: add imx pinctrl core driver")
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
[ luis: backported to 3.16:
  - file rename: drivers/pinctrl/freescale/pinctrl-imx.c ->
    drivers/pinctrl/pinctrl-imx.c ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 79e43709
...@@ -365,7 +365,7 @@ static void imx_pinconf_dbg_show(struct pinctrl_dev *pctldev, ...@@ -365,7 +365,7 @@ static void imx_pinconf_dbg_show(struct pinctrl_dev *pctldev,
const struct imx_pin_reg *pin_reg = &info->pin_regs[pin_id]; const struct imx_pin_reg *pin_reg = &info->pin_regs[pin_id];
unsigned long config; unsigned long config;
if (!pin_reg || !pin_reg->conf_reg) { if (!pin_reg || pin_reg->conf_reg == -1) {
seq_printf(s, "N/A"); seq_printf(s, "N/A");
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment