From: Axel Lin <axel.lin@ingics.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
spear-devel@list.st.com, linux-kernel@vger.kernel.org
Subject: [PATCH] pinctrl: spear: Fix the logic of setting reg in pmx_init_gpio_pingroup_addr
Date: Tue, 13 Nov 2012 15:31:41 +0800 [thread overview]
Message-ID: <1352791901.3947.1.camel@phoenix> (raw)
Current code does not work if count > 1, fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/pinctrl/spear/pinctrl-spear.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/spear/pinctrl-spear.c b/drivers/pinctrl/spear/pinctrl-spear.c
index f9483ae..107780c 100644
--- a/drivers/pinctrl/spear/pinctrl-spear.c
+++ b/drivers/pinctrl/spear/pinctrl-spear.c
@@ -86,10 +86,10 @@ void __devinit
pmx_init_gpio_pingroup_addr(struct spear_gpio_pingroup *gpio_pingroup,
unsigned count, u16 reg)
{
- int i = 0, j = 0;
+ int i, j;
- for (; i < count; i++)
- for (; j < gpio_pingroup[i].nmuxregs; j++)
+ for (i = 0; i < count; i++)
+ for (j = 0; j < gpio_pingroup[i].nmuxregs; j++)
gpio_pingroup[i].muxregs[j].reg = reg;
}
--
1.7.9.5
next reply other threads:[~2012-11-13 7:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-13 7:31 Axel Lin [this message]
2012-11-15 11:06 ` [PATCH] pinctrl: spear: Fix the logic of setting reg in pmx_init_gpio_pingroup_addr Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1352791901.3947.1.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=spear-devel@list.st.com \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox