From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Mon, 29 Jul 2013 11:16:58 +0200 Subject: [U-Boot] [PATCH] gpio: altera_pio: Fix inversed logic of gpio_is_valid() implementation In-Reply-To: <1371287438.4051.2.camel@phoenix> References: <1371287438.4051.2.camel@phoenix> Message-ID: <20130729111658.39cc0c27@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Axel, On Sat, 15 Jun 2013 17:10:38 +0800, Axel Lin wrote: > The implementation of gpio_is_valid() has inversed logic, fix it. > > Signed-off-by: Axel Lin > --- > Hi, > I don't have this hardware to test, but current code looks obviously wrong. > I'd appreciate if someone can review and test this patch. > > Axel > drivers/gpio/altera_pio.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Not sure why this was assigned to me, as this is not ARM related. Delegating to Thomas Chou as the NIOS(II) custodian and Cc:ing him, as well as Scott McNutt, nios2-generic maintainer. > diff --git a/drivers/gpio/altera_pio.c b/drivers/gpio/altera_pio.c > index fb03760..7ab6df8 100644 > --- a/drivers/gpio/altera_pio.c > +++ b/drivers/gpio/altera_pio.c > @@ -294,6 +294,6 @@ int gpio_is_valid(int number) > int gidx = altera_pio_gidx(number); > > if (gidx < 0) > - return 1; > - return 0; > + return 0; > + return 1; > } Amicalement, -- Albert.