From patchwork Fri Jan 22 02:44:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 571514 X-Patchwork-Delegate: sjg@chromium.org 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 9E63D14017E for ; Fri, 22 Jan 2016 14:22:52 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=TDpdPaCB; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 593BE4BE53; Fri, 22 Jan 2016 04:22:47 +0100 (CET) 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 dTudk1Mqh0VL; Fri, 22 Jan 2016 04:22:47 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3C8514BED0; Fri, 22 Jan 2016 04:17:50 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 936F04BF88 for ; Fri, 22 Jan 2016 04:16:27 +0100 (CET) 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 FxV21gfLn-kx for ; Fri, 22 Jan 2016 04:16:27 +0100 (CET) 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-oi0-f50.google.com (mail-oi0-f50.google.com [209.85.218.50]) by theia.denx.de (Postfix) with ESMTPS id 2280FA768B for ; Fri, 22 Jan 2016 04:04:27 +0100 (CET) Received: by mail-oi0-f50.google.com with SMTP id k206so40078093oia.1 for ; Thu, 21 Jan 2016 19:04:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=E6RL04vyvXEQZQRwYskt9j9ko3g2ybCMwLzbnO7p820=; b=TDpdPaCBMAJx572l7Vd3UW5ggchesyoSUXDJ7WGArQXbZjruagG8zFm8EtyW4AHjrk Vsu9JzFlH4ib7OjBwNSm66X6nlPr+jYjRjMpkH2lCVX5j++0ZNrpKSS3btrATBV6WJPT BOIxGrIfJ7v3Isi+9lHFUapKIyvw0NcCqUNKs83AsyEXfmKPrAD7KRfaV10N8mapQTpT MdRXgcZYig1iNFnnmcKVm7AOI4JxQ0wPb11JaR0Kl7V7XsBQTcyux6Vi+OQUYBHY5FF3 HyKbDBkR5SHb7LZYmpXxEOZw4ib7dWXDzoXD8Q5iOB5lCUUYQti9pl1dsn2NyEGF5EkD Lnmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=E6RL04vyvXEQZQRwYskt9j9ko3g2ybCMwLzbnO7p820=; b=Xl5cK6QQ7ZILeJIatniKVFV/r7dhMuNBZUC3KUYNg+DULHUN4m39+dcSDDDj0BS3Ly vKGtrDBfsfI6SPRlPr72vh8/7+gtJmXvNpblF3j+C0gunIbP1WkBKud5VZ8Lfno264m8 uRpPe5toA7TGZENdyLnoxzgIIogYs1yGy3K35Qdfny8kKeYZAAyt4GSo7r8U/cbdktP3 3va+apJt7Mh8k7hoKnEwg0cKwxhil3joq4RxfwqsxsjwZ7KWKOP//yRMChftHpq8mzud FKZmrJnRyU50GUV+QJ+fBel99zVXQ1t3WYqRYwjC0iNaiOHkgzXxH0qh/kTTwxAGF3ER ccBw== X-Gm-Message-State: AG10YORX32riXLkTqKxFEw4wd9kcAC6Z6Lngau2Pmu7OwN8/d/HL/p8FcoqHzhHti5j5i+oK X-Received: by 10.202.203.198 with SMTP id b189mr494507oig.39.1453431865553; Thu, 21 Jan 2016 19:04:25 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id gx2sm2141888obc.18.2016.01.21.19.04.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jan 2016 19:04:24 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 636022219E1; Thu, 21 Jan 2016 19:45:28 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Thu, 21 Jan 2016 19:44:50 -0700 Message-Id: <1453430725-4641-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1453430725-4641-1-git-send-email-sjg@chromium.org> References: <1453430725-4641-1-git-send-email-sjg@chromium.org> Cc: Tom Cubie , Jeffy Chen Subject: [U-Boot] [PATCH v2 02/37] gpio: Warn about invalid GPIOs used with the 'gpio' command X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present there is no indication that an invalid GPIO is used except that the GPIO status is not displayed. Make the error more explicit to avoid confusion. Signed-off-by: Simon Glass --- Changes in v2: None common/cmd_gpio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/cmd_gpio.c b/common/cmd_gpio.c index bb0f63a..2b78b16 100644 --- a/common/cmd_gpio.c +++ b/common/cmd_gpio.c @@ -174,8 +174,10 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) * GPIO compatibility layer. */ ret = gpio_lookup_name(str_gpio, NULL, NULL, &gpio); - if (ret) + if (ret) { + printf("GPIO: '%s' not found\n", str_gpio); return cmd_process_error(cmdtp, ret); + } #else /* turn the gpio name into a gpio number */ gpio = name_to_gpio(str_gpio);