summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinctrl-msm.c
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@sonymobile.com>2014-04-01 01:49:55 +0400
committerLinus Walleij <linus.walleij@linaro.org>2014-04-22 10:41:34 +0400
commit3c25381f9b3375c326f5ead194cb91b5ac181f08 (patch)
treeb13b9ecf342307ba0666a4f47569660ab09f7648 /drivers/pinctrl/pinctrl-msm.c
parent130cbe3082a1d69e7009b8c1dabb44babedd9269 (diff)
downloadlinux-3c25381f9b3375c326f5ead194cb91b5ac181f08.tar.xz
pinctrl: msm: Make number of functions variable
The various pins may have different number of functions defined, so make this number definable per pin instead of just increasing it to the largest one for all of the platforms. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-msm.c')
-rw-r--r--drivers/pinctrl/pinctrl-msm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-msm.c b/drivers/pinctrl/pinctrl-msm.c
index e43fbce56598..5fa9341cc589 100644
--- a/drivers/pinctrl/pinctrl-msm.c
+++ b/drivers/pinctrl/pinctrl-msm.c
@@ -145,12 +145,12 @@ static int msm_pinmux_enable(struct pinctrl_dev *pctldev,
if (WARN_ON(g->mux_bit < 0))
return -EINVAL;
- for (i = 0; i < ARRAY_SIZE(g->funcs); i++) {
+ for (i = 0; i < g->nfuncs; i++) {
if (g->funcs[i] == function)
break;
}
- if (WARN_ON(i == ARRAY_SIZE(g->funcs)))
+ if (WARN_ON(i == g->nfuncs))
return -EINVAL;
spin_lock_irqsave(&pctrl->lock, flags);