mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland Stigge <stigge@antcom.de>
To: ralf@linux-mips.org, blogic@openwrt.org, jkosina@suse.cz,
	standby24x7@gmail.com, bhelgaas@google.com,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
	grant.likely@secretlab.ca, linus.walleij@stericsson.com
Cc: Roland Stigge <stigge@antcom.de>
Subject: [PATCH RESEND] mips: pci-lantiq: Fix check for valid gpio
Date: Thu, 28 Jun 2012 00:36:57 +0200	[thread overview]
Message-ID: <1340836617-21666-1-git-send-email-stigge@antcom.de> (raw)

This patch fixes two checks for valid gpio number, formerly (wrongly)
considering zero as invalid, now using gpio_is_valid().

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
Applies to v3.5-rc4

 arch/mips/pci/pci-lantiq.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.orig/arch/mips/pci/pci-lantiq.c
+++ linux-2.6/arch/mips/pci/pci-lantiq.c
@@ -129,7 +129,7 @@ static int __devinit ltq_pci_startup(str
 
 	/* setup reset gpio used by pci */
 	reset_gpio = of_get_named_gpio(node, "gpio-reset", 0);
-	if (reset_gpio > 0)
+	if (gpio_is_valid(reset_gpio))
 		devm_gpio_request(&pdev->dev, reset_gpio, "pci-reset");
 
 	/* enable auto-switching between PCI and EBU */
@@ -192,7 +192,7 @@ static int __devinit ltq_pci_startup(str
 	ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_PCC_IEN) | 0x10, LTQ_EBU_PCC_IEN);
 
 	/* toggle reset pin */
-	if (reset_gpio > 0) {
+	if (gpio_is_valid(reset_gpio)) {
 		__gpio_set_value(reset_gpio, 0);
 		wmb();
 		mdelay(1);

             reply	other threads:[~2012-06-27 22:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-27 22:36 Roland Stigge [this message]
2012-06-28  5:19 ` John Crispin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340836617-21666-1-git-send-email-stigge@antcom.de \
    --to=stigge@antcom.de \
    --cc=bhelgaas@google.com \
    --cc=blogic@openwrt.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jkosina@suse.cz \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=standby24x7@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®