From patchwork Sat Dec 22 18:27:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Dunn X-Patchwork-Id: 1906171 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id E4D3E3FCA5 for ; Sat, 22 Dec 2012 18:31:09 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TmTnU-0008Go-JF; Sat, 22 Dec 2012 18:27:44 +0000 Received: from smtp.newsguy.com ([74.209.136.69]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TmTnH-0008GB-6E for linux-arm-kernel@lists.infradead.org; Sat, 22 Dec 2012 18:27:32 +0000 Received: from localhost.localdomain (84.sub-70-199-227.myvzw.com [70.199.227.84]) by smtp.newsguy.com (8.14.3/8.14.3) with ESMTP id qBMIREEZ072260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 22 Dec 2012 10:27:28 -0800 (PST) (envelope-from mikedunn@newsguy.com) From: Mike Dunn To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] ARM: pxa: palm27x: fix lcd device initialization Date: Sat, 22 Dec 2012 10:27:40 -0800 Message-Id: <1356200860-3241-3-git-send-email-mikedunn@newsguy.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1356200860-3241-1-git-send-email-mikedunn@newsguy.com> References: <1356200860-3241-1-git-send-email-mikedunn@newsguy.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121222_132731_478852_6FB7BDA1 X-CRM114-Status: UNSURE ( 9.54 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: marex@denx.de, Mike Dunn X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This fixes incorrect tests of the return codes from gpiolib functions in palm27x_lcd_init(). Currently a return code of 0 is incorrectly interpreted as an error. A call to gpio_free() is also added. Signed-off-by: Mike Dunn Acked-by: Marek Vasut --- arch/arm/mach-pxa/palm27x.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-pxa/palm27x.c b/arch/arm/mach-pxa/palm27x.c index 298a8a9..473c9e3 100644 --- a/arch/arm/mach-pxa/palm27x.c +++ b/arch/arm/mach-pxa/palm27x.c @@ -145,12 +145,13 @@ void __init palm27x_lcd_init(int power, struct pxafb_mode_info *mode) palm27x_lcd_screen.modes = mode; if (gpio_is_valid(power)) { - if (!gpio_request(power, "LCD power")) { + if (gpio_request(power, "LCD power") < 0) { pr_err("Palm27x: failed to claim lcd power gpio!\n"); return; } - if (!gpio_direction_output(power, 1)) { + if (gpio_direction_output(power, 1) < 0) { pr_err("Palm27x: lcd power configuration failed!\n"); + gpio_free(power); return; } palm27x_lcd_power = power;