20 Jun 2012 12:13
[PATCH v2] pinctrl: pinctrl-imx: fix map setting problem if NO_PAD_CTL is set
Hui Wang <jason77.wang <at> gmail.com>
2012-06-20 10:13:47 GMT
2012-06-20 10:13:47 GMT
new_map is allocated according to map_num instead of grp->npins, if a pin or some pins of a group has NO_PAD_CTL property, the map_num and the grp->npin are different definitely. When we set mapping information to the new_map[], we should skip those pins with NO_PAD_CTL from index, otherwise it is possible the driver will aceesss to a unallocated region. Cc: Dong Aisheng <dong.aisheng <at> linaro.org> Cc: Linus Walleij <linus.walleij <at> linaro.org> Cc: Shawn Guo <shawn.guo <at> linaro.org> Signed-off-by: Hui Wang <jason77.wang <at> gmail.com> --- In the v2, according to dong.aisheng's suggestion, change to use j as index. drivers/pinctrl/pinctrl-imx.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-imx.c b/drivers/pinctrl/pinctrl-imx.c index dd6d93a..2bafb5d 100644 --- a/drivers/pinctrl/pinctrl-imx.c +++ b/drivers/pinctrl/pinctrl-imx.c <at> <at> -146,7 +146,7 <at> <at> static int imx_dt_node_to_map(struct pinctrl_dev *pctldev, struct pinctrl_map *new_map; struct device_node *parent; int map_num = 1; - int i; + int i, j; /*(Continue reading)
RSS Feed