All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mips: pci-lantiq: Fix check for valid gpio
@ 2012-06-18  9:28 Roland Stigge
  2012-06-19 21:50 ` Linus Walleij
  2012-07-05 13:02 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Roland Stigge @ 2012-06-18  9:28 UTC (permalink / raw)
  To: ralf, blogic, jkosina, standby24x7, bhelgaas, linux-mips,
	linux-kernel, grant.likely, linus.walleij
  Cc: Roland Stigge

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>
---
 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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mips: pci-lantiq: Fix check for valid gpio
  2012-06-18  9:28 [PATCH] mips: pci-lantiq: Fix check for valid gpio Roland Stigge
@ 2012-06-19 21:50 ` Linus Walleij
  2012-07-05 13:02 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2012-06-19 21:50 UTC (permalink / raw)
  To: Roland Stigge
  Cc: ralf, blogic, jkosina, standby24x7, bhelgaas, linux-mips,
	linux-kernel, grant.likely, linus.walleij

On Mon, Jun 18, 2012 at 11:28 AM, Roland Stigge <stigge@antcom.de> wrote:

> 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>

Thanks,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mips: pci-lantiq: Fix check for valid gpio
  2012-06-18  9:28 [PATCH] mips: pci-lantiq: Fix check for valid gpio Roland Stigge
  2012-06-19 21:50 ` Linus Walleij
@ 2012-07-05 13:02 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2012-07-05 13:02 UTC (permalink / raw)
  To: Roland Stigge
  Cc: ralf, blogic, jkosina, standby24x7, bhelgaas, linux-mips,
	linux-kernel, grant.likely, linus.walleij

On Mon, Jun 18, 2012 at 11:28 AM, Roland Stigge <stigge@antcom.de> wrote:

> 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>

Applied.

Thanks,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-05 13:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-18  9:28 [PATCH] mips: pci-lantiq: Fix check for valid gpio Roland Stigge
2012-06-19 21:50 ` Linus Walleij
2012-07-05 13:02 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.