提交 7864d926 编写于 作者: S Sebastian Hesselbarth 提交者: Linus Walleij

pinctrl: mvebu: fix num_settings in mpp group assignment

When assigning mpp settings from static mpp modes to mpp groups,
we do not want any groups that have no supported setting for a
specific Kirkwood variant. However, when there is at least a
single supported setting, we need to assign the number of all
settings in this mode to grp->num_settings as we are reusing
the static modes table.

Fixes: 0581b16b ("pinctrl: mvebu: complain about missing group after checking variant")
Reported-by: NAaro Koskinen <aaro.koskinen@iki.fi>
Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi>
Cc: Gregory Clement <gregory.clement@free-electrons.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: NSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 111f2b87
...@@ -666,16 +666,19 @@ int mvebu_pinctrl_probe(struct platform_device *pdev) ...@@ -666,16 +666,19 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
struct mvebu_mpp_ctrl_setting *set = &mode->settings[0]; struct mvebu_mpp_ctrl_setting *set = &mode->settings[0];
struct mvebu_pinctrl_group *grp; struct mvebu_pinctrl_group *grp;
unsigned num_settings; unsigned num_settings;
unsigned supp_settings;
for (num_settings = 0; ; set++) { for (num_settings = 0, supp_settings = 0; ; set++) {
if (!set->name) if (!set->name)
break; break;
num_settings++;
/* skip unsupported settings for this variant */ /* skip unsupported settings for this variant */
if (pctl->variant && !(pctl->variant & set->variant)) if (pctl->variant && !(pctl->variant & set->variant))
continue; continue;
num_settings++; supp_settings++;
/* find gpio/gpo/gpi settings */ /* find gpio/gpo/gpi settings */
if (strcmp(set->name, "gpio") == 0) if (strcmp(set->name, "gpio") == 0)
...@@ -688,7 +691,7 @@ int mvebu_pinctrl_probe(struct platform_device *pdev) ...@@ -688,7 +691,7 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
} }
/* skip modes with no settings for this variant */ /* skip modes with no settings for this variant */
if (!num_settings) if (!supp_settings)
continue; continue;
grp = mvebu_pinctrl_find_group_by_pid(pctl, mode->pid); grp = mvebu_pinctrl_find_group_by_pid(pctl, mode->pid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册