mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Stephen Warren <swarren@nvidia.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Randy Dunlap <rdunlap@xenotime.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: Re: [PATCH] Documentation/pinctrl: various minor fixes
Date: Thu, 8 Dec 2011 23:31:44 +0100	[thread overview]
Message-ID: <20111208223144.GQ4585@pengutronix.de> (raw)
In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF1750B77B9F@HQMAIL01.nvidia.com>

On Thu, Dec 08, 2011 at 02:24:46PM -0800, Stephen Warren wrote:
> Uwe Kleine-König wrote at Thursday, December 08, 2011 3:22 PM:
> > - add some consts
> > - don't use the group index alone to determine the value to write to
> >   foo's mux register. For spi and i2c the group index is always 0.
> >   Additionally using the function index makes much more sense as it
> >   generates a different value for each function/group pair.
> > - fix a few syntax errors
> 
> > @@ -600,7 +600,7 @@ static int foo_get_groups(struct pinctrl_dev *pctldev, unsigned selector,
> >  int foo_enable(struct pinctrl_dev *pctldev, unsigned selector,
> >  		unsigned group)
> >  {
> > -	u8 regbit = (1 << group);
> > +	u8 regbit = (1 << selector + group);
> > 
> >  	writeb((readb(MUX)|regbit), MUX)
> >  	return 0;
> > @@ -609,7 +609,7 @@ int foo_enable(struct pinctrl_dev *pctldev, unsigned selector,
> >  int foo_disable(struct pinctrl_dev *pctldev, unsigned selector,
> >  		unsigned group)
> >  {
> > -	u8 regbit = (1 << group);
> > +	u8 regbit = (1 << selector);
> > 
> >  	writeb((readb(MUX) & ~(regbit)), MUX)
> >  	return 0;
> 
> Shouldn't those two regbit calculations match?
Yes, of course. (Well, it depends on the register model ...)

Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2011-12-08 22:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-08 22:21 Uwe Kleine-König
2011-12-08 22:24 ` Stephen Warren
2011-12-08 22:31   ` Uwe Kleine-König [this message]
2011-12-08 22:36   ` [PATCH v2] " Uwe Kleine-König
2011-12-08 22:41     ` Stephen Warren
2011-12-09 11:02     ` Linus Walleij
2012-01-19 21:35     ` [PATCH] Documentation/pinctrl: fix a few syntax errors in code examples Uwe Kleine-König
2012-01-24 21:45       ` 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=20111208223144.GQ4585@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=swarren@nvidia.com \
    /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®