diff options
author | Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 2016-02-01 17:48:23 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-02-13 17:51:45 -0500 |
commit | 7864d92621b6897595fa698b27240828592ebd71 (patch) | |
tree | 6cd818eda86f50f6af50defe4740965c3f7c79f6 /drivers/pinctrl/mvebu | |
parent | 111f2b87326199a736c3469265763a6be6e5528f (diff) |
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: 0581b16b1840 ("pinctrl: mvebu: complain about missing group after checking variant")
Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Tested-by: Aaro 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: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/mvebu')
-rw-r--r-- | drivers/pinctrl/mvebu/pinctrl-mvebu.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c index e4d473811bb3..3ef798fac81b 100644 --- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c +++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c | |||
@@ -666,16 +666,19 @@ int mvebu_pinctrl_probe(struct platform_device *pdev) | |||
666 | struct mvebu_mpp_ctrl_setting *set = &mode->settings[0]; | 666 | struct mvebu_mpp_ctrl_setting *set = &mode->settings[0]; |
667 | struct mvebu_pinctrl_group *grp; | 667 | struct mvebu_pinctrl_group *grp; |
668 | unsigned num_settings; | 668 | unsigned num_settings; |
669 | unsigned supp_settings; | ||
669 | 670 | ||
670 | for (num_settings = 0; ; set++) { | 671 | for (num_settings = 0, supp_settings = 0; ; set++) { |
671 | if (!set->name) | 672 | if (!set->name) |
672 | break; | 673 | break; |
673 | 674 | ||
675 | num_settings++; | ||
676 | |||
674 | /* skip unsupported settings for this variant */ | 677 | /* skip unsupported settings for this variant */ |
675 | if (pctl->variant && !(pctl->variant & set->variant)) | 678 | if (pctl->variant && !(pctl->variant & set->variant)) |
676 | continue; | 679 | continue; |
677 | 680 | ||
678 | num_settings++; | 681 | supp_settings++; |
679 | 682 | ||
680 | /* find gpio/gpo/gpi settings */ | 683 | /* find gpio/gpo/gpi settings */ |
681 | if (strcmp(set->name, "gpio") == 0) | 684 | if (strcmp(set->name, "gpio") == 0) |
@@ -688,7 +691,7 @@ int mvebu_pinctrl_probe(struct platform_device *pdev) | |||
688 | } | 691 | } |
689 | 692 | ||
690 | /* skip modes with no settings for this variant */ | 693 | /* skip modes with no settings for this variant */ |
691 | if (!num_settings) | 694 | if (!supp_settings) |
692 | continue; | 695 | continue; |
693 | 696 | ||
694 | grp = mvebu_pinctrl_find_group_by_pid(pctl, mode->pid); | 697 | grp = mvebu_pinctrl_find_group_by_pid(pctl, mode->pid); |