[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1340011706-32281-1-git-send-email-stigge@antcom.de>
Date: Mon, 18 Jun 2012 11:28:26 +0200
From: Roland Stigge <stigge@...com.de>
To: ralf@...ux-mips.org, blogic@...nwrt.org, jkosina@...e.cz,
standby24x7@...il.com, bhelgaas@...gle.com,
linux-mips@...ux-mips.org, linux-kernel@...r.kernel.org,
grant.likely@...retlab.ca, linus.walleij@...ricsson.com
Cc: Roland Stigge <stigge@...com.de>
Subject: [PATCH] mips: pci-lantiq: Fix check for valid gpio
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@...com.de>
---
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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists