lkml.org 
[lkml]   [2009]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drivers/w1/masters/w1-gpio.c: fix read_bit()
On Mon, Mar 09, 2009 at 07:14:19PM -0700, Andrew Morton wrote:
> > --- a/drivers/w1/masters/w1-gpio.c
> > +++ b/drivers/w1/masters/w1-gpio.c
> > @@ -39,7 +39,7 @@ static u8 w1_gpio_read_bit(void *data)
> > {
> > struct w1_gpio_platform_data *pdata = data;
> >
> > - return gpio_get_value(pdata->pin);
> > + return gpio_get_value(pdata->pin) ? 1 : 0;
> > }
> >
> > static int __init w1_gpio_probe(struct platform_device *pdev)
>
> We recently merged a patch (I forget where) which fixed one
> gpio_get_value() implementation so that it always returns 0 or 1.
>
> From which I deduce that the correct fix for <whatever problem you're
> seeing> is to fix <whichever driver that is>?

I agree those functions should return 0 and 1 only, but my patch fixes
the w1-gpio driver for all platforms at once, so people can use it.

On the other hand, I will submit a patch which modifies PXA's
gpio_get_value() and see what the maintainers say, but I can't go thru
all the implemenations of all architectures to do this.

So for the time being, the above patch helps many users of that driver.

Daniel



\
 
 \ /
  Last update: 2009-03-10 10:21    [W:0.091 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site