From patchwork Wed Oct 8 13:47:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Pargmann X-Patchwork-Id: 5053821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D34FFC11AB for ; Wed, 8 Oct 2014 13:52:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 103FF200FE for ; Wed, 8 Oct 2014 13:52:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E071200F4 for ; Wed, 8 Oct 2014 13:52:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xbrd4-0004NY-OS; Wed, 08 Oct 2014 13:50:10 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xbrb1-000483-NE for linux-arm-kernel@lists.infradead.org; Wed, 08 Oct 2014 13:48:04 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1XbraR-0001yn-GZ; Wed, 08 Oct 2014 15:47:27 +0200 Received: from mpa by dude.hi.pengutronix.de with local (Exim 4.84) (envelope-from ) id 1XbraP-000795-UE; Wed, 08 Oct 2014 15:47:25 +0200 From: Markus Pargmann To: Mark Brown Subject: [PATCH v2 3/4] regulator: fixed: Use gpio_is_valid Date: Wed, 8 Oct 2014 15:47:07 +0200 Message-Id: <1412776028-15655-4-git-send-email-mpa@pengutronix.de> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1412776028-15655-1-git-send-email-mpa@pengutronix.de> References: <1412776028-15655-1-git-send-email-mpa@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: mpa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141008_064803_963741_5F89F2F5 X-CRM114-Status: GOOD ( 11.60 ) X-Spam-Score: -0.0 (/) Cc: =?UTF-8?q?Krzysztof=20Koz=C5=82owski?= , Liam Girdwood , linux-kernel@vger.kernel.org, kernel@pengutronix.de, Markus Pargmann , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use gpio_is_valid instead of an explicit comparison with 0. Signed-off-by: Markus Pargmann --- drivers/regulator/fixed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 441a3e90e266..696f53cc1927 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -157,7 +157,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev) drvdata->desc.fixed_uV = config->microvolts; - if (config->gpio >= 0) { + if (gpio_is_valid(config->gpio)) { cfg.ena_gpio = config->gpio; cfg.ena_gpio_initialized = true; }