From: Kevin Hilman <khilman@linaro.org>
To: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Cc: santosh.shilimkar@ti.com, grant.likely@secretlab.ca,
linus.walleij@linaro.org, balbi@ti.com,
linux-omap@vger.kernel.org, daniel@zonque.org, jon-hunter@ti.com
Subject: Re: [PATCH v3 1/3] gpio/omap: replace open coded read-modify-write with _gpio_rmw function.
Date: Thu, 30 May 2013 07:30:13 -0700 [thread overview]
Message-ID: <874ndka6bu.fsf@linaro.org> (raw)
In-Reply-To: <1368564867-11142-1-git-send-email-andreas.fenkart@streamunlimited.com> (Andreas Fenkart's message of "Tue, 14 May 2013 22:54:25 +0200")
Andreas Fenkart <andreas.fenkart@streamunlimited.com> writes:
> By also making it return the modified value, we save the readl
> needed to update the context.
>
> Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Great cleanups, Thanks!
Some minor comments below...
Also, it would be nice to see a cover letter for this series describing
how it was tested, on what platforms, did it include PM testing
(off-mode, etc.).
[...]
> @@ -94,20 +107,10 @@ static int irq_to_gpio(struct gpio_bank *bank, unsigned int gpio_irq)
>
> static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
> {
> - void __iomem *reg = bank->base;
> - u32 l;
> -
> - reg += bank->regs->direction;
> - l = __raw_readl(reg);
> - if (is_input)
> - l |= 1 << gpio;
> - else
> - l &= ~(1 << gpio);
> - __raw_writel(l, reg);
> - bank->context.oe = l;
> + bank->context.oe = _gpio_rmw(bank->base, bank->regs->direction, 1 <<
> + gpio, is_input);
wrapping is funny here, IMO the "1 <<" should be on the next line along
with "gpio".
[...]
> @@ -450,19 +428,16 @@ static int gpio_irq_type(struct irq_data *d, unsigned type)
>
> static void _clear_gpio_irqbank(struct gpio_bank *bank, int gpio_mask)
> {
> - void __iomem *reg = bank->base;
> + void __iomem *base = bank->base;
>
> - reg += bank->regs->irqstatus;
> - __raw_writel(gpio_mask, reg);
> + __raw_writel(gpio_mask, base + bank->regs->irqstatus);
>
> /* Workaround for clearing DSP GPIO interrupts to allow retention */
> - if (bank->regs->irqstatus2) {
> - reg = bank->base + bank->regs->irqstatus2;
> - __raw_writel(gpio_mask, reg);
> - }
> + if (bank->regs->irqstatus2)
> + __raw_writel(gpio_mask, base + bank->regs->irqstatus2);
>
> /* Flush posted write for the irq status to avoid spurious interrupts */
> - __raw_readl(reg);
> + __raw_readl(base + bank->regs->irqstatus);
All of the changes in this function are not related to the change
described in the changelog. Either make a separate patch, or add a
description of this cleanup to the changelog too.
Thanks,
Kevin
next prev parent reply other threads:[~2013-05-30 14:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-14 20:54 [PATCH v3 1/3] gpio/omap: replace open coded read-modify-write with _gpio_rmw function Andreas Fenkart
2013-05-14 20:54 ` [PATCH v3 2/3] gpio/omap: modify wake-up register with interrupt enable Andreas Fenkart
2013-05-15 12:41 ` Santosh Shilimkar
2013-05-31 22:58 ` Kevin Hilman
2013-05-14 20:54 ` [PATCH v3 3/3] gpio/omap: split irq_mask callback fucntion into irq_disable/irq_mask Andreas Fenkart
2013-05-30 14:30 ` Kevin Hilman [this message]
2013-05-31 8:01 ` [PATCH v3 1/3] gpio/omap: replace open coded read-modify-write with _gpio_rmw function Andreas Fenkart
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=874ndka6bu.fsf@linaro.org \
--to=khilman@linaro.org \
--cc=andreas.fenkart@streamunlimited.com \
--cc=balbi@ti.com \
--cc=daniel@zonque.org \
--cc=grant.likely@secretlab.ca \
--cc=jon-hunter@ti.com \
--cc=linus.walleij@linaro.org \
--cc=linux-omap@vger.kernel.org \
--cc=santosh.shilimkar@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.