[PATCH 1/8] arm: at91: add gpio_is_valid support
Sascha Hauer
s.hauer at pengutronix.de
Tue Oct 30 03:32:44 EDT 2012
On Mon, Oct 29, 2012 at 02:46:57PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> ---
> arch/arm/mach-at91/include/mach/gpio.h | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/include/mach/gpio.h
> index 3533bf9..fa695a6 100644
> --- a/arch/arm/mach-at91/include/mach/gpio.h
> +++ b/arch/arm/mach-at91/include/mach/gpio.h
> @@ -22,6 +22,17 @@
>
> /* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */
>
> +#define ARCH_NR_GPIOS 256
> +
> +static inline int gpio_is_valid(int gpio)
> +{
> + if (gpio < 1)
> + return 0;
> + if (gpio < ARCH_NR_GPIOS)
> + return 1;
> + return 0;
> +}
Why is this patch in this series? It is unused and wrong. 0 is a valid
gpio.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list