lkml.org 
[lkml]   [2012]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] GPIO: gpio-pxa: fix bug when get gpio value
From
On Tue, Sep 25, 2012 at 2:03 PM, Neil Zhang <zhangwm@marvell.com> wrote:

> We need to return 0 or 1 when get gpio value.

OK...

> static int pxa_gpio_get(struct gpio_chip *chip, unsigned offset)
> {
> - return readl_relaxed(gpio_chip_base(chip) + GPLR_OFFSET) & (1 << offset);
> + u32 gplr = __raw_readl(gpio_chip_base(chip) + GPLR_OFFSET);
> + u32 mask = 1 << offset;
> +
> + return (gplr & mask) != 0;

So why are you switching the perfectly working readl_relaxed() call to
a __raw_readl()?

Please don't do this, and respin the patch.

Yours,
Linus Walleij


\
 
 \ /
  Last update: 2012-09-30 11:01    [W:1.903 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site