From patchwork Sat Jun 15 09:10:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 251592 X-Patchwork-Delegate: thomas@wytron.com.tw Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id EEC4C2C00A7 for ; Sat, 15 Jun 2013 19:11:12 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1F1AD4A021; Sat, 15 Jun 2013 11:11:09 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sWazIwTDZXyV; Sat, 15 Jun 2013 11:11:08 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 164A74A019; Sat, 15 Jun 2013 11:11:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AF9474A019 for ; Sat, 15 Jun 2013 11:10:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g5lCBEBU1jEY for ; Sat, 15 Jun 2013 11:10:52 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by theia.denx.de (Postfix) with ESMTPS id 4EB3A4A018 for ; Sat, 15 Jun 2013 11:10:46 +0200 (CEST) Received: by mail-pb0-f54.google.com with SMTP id ro2so1277978pbb.27 for ; Sat, 15 Jun 2013 02:10:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:x-mailer :mime-version:content-transfer-encoding:x-gm-message-state; bh=60dzG31wtODRXt+d8BKuXfw76In6OodKGKHzTx02DJ8=; b=dkDD8/+0UqOi+WHJREM02WyMxAhU+pnsOjjTS57vEpxHNosuPgnGwPrczlJNBB7RtK ZsoQt+mGo634iroe51uz06z2dHQ1KswS8xofsIal02gYrjcV4uOD3JEJUF33L6tQAPnm D+MCYu4mTChzzjUguBTbcyvLyn9lEKSlXVBeZGph4txc6kXNKRzh1Wk8cmuMSJKWWgOW o4s4augolgFRv7rofWu/INOXH8QIRcoDHW97ZEsXIGXHAWXT0RidsciWmFp+gY+vtFA3 J/GV4iD3rirj/Bq3HabOkHbJX0V0lJ06wMIso7SSn39Aq3wmR3ZeIrUbAL4VkXGgOGKQ Ribw== X-Received: by 10.68.216.161 with SMTP id or1mr5673672pbc.147.1371287443318; Sat, 15 Jun 2013 02:10:43 -0700 (PDT) Received: from [114.39.105.11] (114-39-105-11.dynamic.hinet.net. [114.39.105.11]) by mx.google.com with ESMTPSA id p2sm5909771pag.22.2013.06.15.02.10.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Jun 2013 02:10:42 -0700 (PDT) Message-ID: <1371287438.4051.2.camel@phoenix> From: Axel Lin To: Thomas Chou Date: Sat, 15 Jun 2013 17:10:38 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 X-Gm-Message-State: ALoCoQn8RT6Xp05U+4++2FSkFUvzhSp6W4KxUxA3MOt5RT3IfIZO/UQANhQbezaUSLvDFEaNZccm Cc: Joachim Foerster , McNutt , Alex Hornung , Scott@theia.denx.de, u-boot@lists.denx.de Subject: [U-Boot] [PATCH] gpio: altera_pio: Fix inversed logic of gpio_is_valid() implementation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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(-) 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; }