[PATCH 1/8] arm: at91: add gpio_is_valid support

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Tue Oct 30 04:41:34 EDT 2012


On 08:32 Tue 30 Oct     , Sascha Hauer wrote:
> 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.
not on at91

0 means invalid

It ws the case on the kernel too before I wrok on the pinctrl

I'll clenaup it too whe I swtich to gpiolib buta bit later

Best Regards,
J.



More information about the barebox mailing list