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 Tue, Mar 10, 2009 at 03:00:59PM -0700, Andrew Morton wrote:
> > > 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.
> >
>
> Problem is, the patch will just conceal bugs.

There is a small discussion about that on the arm-linux mailing list and
what people pointed out there is that gpio_get_value() is _not_ supposed
to return 0 or 1 only, also according to Documentation/gpio.txt:

Use these calls to access such GPIOs:

/* GPIO INPUT: return zero or nonzero */
int gpio_get_value(unsigned gpio);

Hence, any implementation of gpio_get_value() which returns 0 and 1 only
is conform to the docs, but PXA's (which doesn't follow that rule) is as
well. And that means that any driver using that function has to deal
with values > 1 being returned by it, right?

Correct me if I missed the point, but I don't see how my patch will
conceal any bug?

Daniel



\
 
 \ /
  Last update: 2009-03-11 01:13    [W:0.100 / U:0.936 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site