mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rajendra Nayak <rnayak@ti.com>
To: <linus.walleij@linaro.org>, <linus.walleij@stericsson.com>
Cc: <linux-kernel@vger.kernel.org>, <linaro-dev@lists.linaro.org>,
	Rajendra Nayak <rnayak@ti.com>
Subject: [PATCH] pinctrl: Iterate over u300_pmx_mask's in u300_pmx_endisable
Date: Tue, 15 Nov 2011 12:10:26 +0530	[thread overview]
Message-ID: <1321339226-29968-1-git-send-email-rnayak@ti.com> (raw)

Fix u300_pmx_endisable() to iterate over the list of 'bits' and
'mask' populated as part of u300_pmx_functions.mask[]

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
Linus W,
I am not sure if this is a right fix. I just stumbled
upon this while looking at the u300 pinmux driver
while I was writing one for OMAP. Maybe I am reading
the code completely wrong, and I don't even have a
way to test this, so its just compile tested with
u300_defconfig.

 drivers/pinctrl/pinmux-u300.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinmux-u300.c b/drivers/pinctrl/pinmux-u300.c
index 4858a64..145a84d 100644
--- a/drivers/pinctrl/pinmux-u300.c
+++ b/drivers/pinctrl/pinmux-u300.c
@@ -940,20 +940,23 @@ static void u300_pmx_endisable(struct u300_pmx *upmx, unsigned selector,
 {
 	u16 regval, val, mask;
 	int i;
+	const struct u300_pmx_mask *upmx_mask;
 
+	upmx_mask = u300_pmx_functions[selector].mask;
 	for (i = 0; i < ARRAY_SIZE(u300_pmx_registers); i++) {
 		if (enable)
-			val = u300_pmx_functions[selector].mask->bits;
+			val = upmx_mask->bits;
 		else
 			val = 0;
 
-		mask = u300_pmx_functions[selector].mask->mask;
+		mask = upmx_mask->mask;
 		if (mask != 0) {
 			regval = readw(upmx->virtbase + u300_pmx_registers[i]);
 			regval &= ~mask;
 			regval |= val;
 			writew(regval, upmx->virtbase + u300_pmx_registers[i]);
 		}
+		upmx_mask++;
 	}
 }
 
-- 
1.7.1


             reply	other threads:[~2011-11-15  6:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15  6:40 Rajendra Nayak [this message]
2011-11-17  8:01 ` 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=1321339226-29968-1-git-send-email-rnayak@ti.com \
    --to=rnayak@ti.com \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®