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

From: David Brownell
Date: Tue Sep 07 2010 - 19:45:06 EST




--- On Tue, 9/7/10, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> 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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/