* [PATCH] gpio: pxa: normalize the return value for gpio_get
@ 2014-01-10 6:03 Neil Zhang
2014-01-15 7:57 ` Linus Walleij
0 siblings, 1 reply; 3+ messages in thread
From: Neil Zhang @ 2014-01-10 6:03 UTC (permalink / raw)
To: linus.walleij, gnurou, linux-gpio, linux-kernel; +Cc: Neil Zhang
It would be convenient to normalize the return value for gpio_get.
I have checked mach-mmp / mach-pxa / plat-pxa / plat-orion / mach-orion5x.
It's OK for all of them to change this function to return 0 and 1.
Signed-off-by: Neil Zhang <zhangwm@marvell.com>
---
drivers/gpio/gpio-pxa.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index cc13d1b..42e6e64 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -263,7 +263,8 @@ static int pxa_gpio_direction_output(struct gpio_chip *chip,
static int pxa_gpio_get(struct gpio_chip *chip, unsigned offset)
{
- return readl_relaxed(gpio_chip_base(chip) + GPLR_OFFSET) & (1 << offset);
+ u32 gplr = readl_relaxed(gpio_chip_base(chip) + GPLR_OFFSET);
+ return !!(gplr & (1 << offset));
}
static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio: pxa: normalize the return value for gpio_get
2014-01-10 6:03 [PATCH] gpio: pxa: normalize the return value for gpio_get Neil Zhang
@ 2014-01-15 7:57 ` Linus Walleij
2014-01-15 8:26 ` Neil Zhang
0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2014-01-15 7:57 UTC (permalink / raw)
To: Neil Zhang
Cc: Alexandre Courbot, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org
On Fri, Jan 10, 2014 at 7:03 AM, Neil Zhang <zhangwm@marvell.com> wrote:
> It would be convenient to normalize the return value for gpio_get.
>
> I have checked mach-mmp / mach-pxa / plat-pxa / plat-orion / mach-orion5x.
> It's OK for all of them to change this function to return 0 and 1.
>
> Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Bah I updated the commit message a bit ... you dropped the
gpio: pxa: etc from the previous patch, not good but don't worry
I fixed it up.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] gpio: pxa: normalize the return value for gpio_get
2014-01-15 7:57 ` Linus Walleij
@ 2014-01-15 8:26 ` Neil Zhang
0 siblings, 0 replies; 3+ messages in thread
From: Neil Zhang @ 2014-01-15 8:26 UTC (permalink / raw)
To: Linus Walleij
Cc: Alexandre Courbot, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org
> -----Original Message-----
> From: Linus Walleij [mailto:linus.walleij@linaro.org]
> Sent: 2014年1月15日 15:58
> To: Neil Zhang
> Cc: Alexandre Courbot; linux-gpio@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] gpio: pxa: normalize the return value for gpio_get
>
> On Fri, Jan 10, 2014 at 7:03 AM, Neil Zhang <zhangwm@marvell.com> wrote:
>
> > It would be convenient to normalize the return value for gpio_get.
> >
> > I have checked mach-mmp / mach-pxa / plat-pxa / plat-orion / mach-orion5x.
> > It's OK for all of them to change this function to return 0 and 1.
> >
> > Signed-off-by: Neil Zhang <zhangwm@marvell.com>
>
> Bah I updated the commit message a bit ... you dropped the
> gpio: pxa: etc from the previous patch, not good but don't worry I fixed it up.
>
Thanks!
> Yours,
> Linus Walleij
Best Regards,
Neil Zhang
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-15 8:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-10 6:03 [PATCH] gpio: pxa: normalize the return value for gpio_get Neil Zhang
2014-01-15 7:57 ` Linus Walleij
2014-01-15 8:26 ` Neil Zhang
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).