pinctrl: imx: fix NO_PAD_CTL setting for MMIO pads
authorA.s. Dong <aisheng.dong@nxp.com>
Mon, 12 Nov 2018 15:25:48 +0000 (15:25 +0000)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 19 Nov 2018 13:51:42 +0000 (14:51 +0100)
commit571610678bf344006ab4c47c6fd0a842e9ac6a1b
tree1119d8c6a9c9a1656e3b63c977f073b39c30b5b0
parent81c9d563cc7413135f398d95676f947877f9cf0f
pinctrl: imx: fix NO_PAD_CTL setting for MMIO pads

After patch b96eea718bf6 ("pinctrl: fsl: add scu based pinctrl support"),
NO_PAD_CTL pads map are not skipped anymore which results in
a possible memory corruption. As we actually only need to create config
maps for SCU pads and MMIO pads which are not using the default config
(a.k.a IMX_NO_PAD_CTL), so let's add a proper check before creating
the config maps. And during MMIO pads parsing, we also need update the
list_p point as SCU case to ensure the pin data next parsed is correct.

Cc: Linus Walleij <linus.walleij@linaro.org>
Fixes: b96eea718bf6 ("pinctrl: fsl: add scu based pinctrl support")
Reported-by: Martin Kaiser <martin@kaiser.cx>
Suggested-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Leonard Crestez <leonard.crestez@nxp.com>
Tested-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/freescale/pinctrl-imx.c