linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shc_work@mail.ru (Alexander Shiyan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] GPIO: Add support for GPIO on CLPS711X-target platform
Date: Fri, 24 Aug 2012 07:45:52 +0400	[thread overview]
Message-ID: <20120824074552.97d32478.shc_work@mail.ru> (raw)
In-Reply-To: <CACRpkdZrcBLz+sg-AwWnBD0SA697uWQzocUYnbC1nPYG14LYyA@mail.gmail.com>

Hello.

On Fri, 24 Aug 2012 00:08:45 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:

...
> > +static int gpio_clps711x_get(struct gpio_chip *chip, unsigned offset)
> > +{
> > +       int ret;
> > +       struct clps711x_gpio *gpio = dev_get_drvdata(chip->dev);
> > +
> > +       mutex_lock(&gpio->lock);
> > +       ret = clps_readb(gpio_clps711x_port_dataaddr(chip)) & (1 << offset);
> > +       mutex_unlock(&gpio->lock);
> > +
> > +       return !!ret;
> > +}
> 
> Please get rid of this clps_readb() business. I can see it's just this:
> #define clps_readb(off)         readb(CLPS711X_VIRT_BASE + (off))
> 
> This makes stuff hard to understand, please pass the virtual base as
> a memory resource to the platform device, store it in the state holder
> and just use readb() in the driver from that offset.

This will break the whole concept of this platform. All the CPU registers
are in one particular area, and therefore access to the registers of all
the drivers performed using the macro.
Maybe just add a short comment?

-- 
Alexander Shiyan <shc_work@mail.ru>

  reply	other threads:[~2012-08-24  3:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 11:36 [PATCH] GPIO: Add support for GPIO on CLPS711X-target platform Alexander Shiyan
2012-08-23 22:08 ` Linus Walleij
2012-08-24  3:45   ` Alexander Shiyan [this message]
2012-08-31 22:44     ` Linus Walleij
2012-09-24 17:49       ` Alexander Shiyan

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=20120824074552.97d32478.shc_work@mail.ru \
    --to=shc_work@mail.ru \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).