Messages in this thread | | | Date | Sun, 30 Sep 2012 10:28:55 +0200 | Subject | Re: [PATCH] GPIO: gpio-pxa: fix bug when get gpio value | From | Linus Walleij <> |
| |
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
| |