[PATCH] pio: add arch specific gpio_is_valid() function

David Brownell david-b at pacbell.net
Tue Sep 7 19:44:55 EDT 2010



--- On Tue, 9/7/10, Alan Cox <alan at lxorguk.ukuu.org.uk> wrote:
> > 
> >      device->output_pin = -EINVAL;
> 
> gpio numbers are unsigned in the rest of the API

Minor goof; should have been "int" everywhere,
as implied by the references to negative numbers
in the docs... negatives not used internally, but
preserved for external use (as above).


> 
> It's unfortunate that 0 was used for a GPIO

Intentional:  board schematics and chip docs can
easily match up to Linux this way.  What would be
unfortunate is needing to map hardware docs into
software ones all the time -- error prone.

When the API is used correctly, it's not an issue.




More information about the linux-arm-kernel mailing list