All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] mips: pci-lantiq: Fix check for valid gpio
@ 2012-06-27 22:36 Roland Stigge
  2012-06-28  5:19 ` John Crispin
  0 siblings, 1 reply; 2+ messages in thread
From: Roland Stigge @ 2012-06-27 22:36 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>
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);

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

* Re: [PATCH RESEND] mips: pci-lantiq: Fix check for valid gpio
  2012-06-27 22:36 [PATCH RESEND] mips: pci-lantiq: Fix check for valid gpio Roland Stigge
@ 2012-06-28  5:19 ` John Crispin
  0 siblings, 0 replies; 2+ messages in thread
From: John Crispin @ 2012-06-28  5:19 UTC (permalink / raw)
  To: ralf
  Cc: Roland Stigge, jkosina, standby24x7, bhelgaas, linux-mips,
	linux-kernel, grant.likely, linus.walleij

On 28/06/12 00:36, Roland Stigge 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>

Acked-by: John Crispin <blogic@openwrt.org>



Hi Ralf,

can you take this via your tree ?

Thanks,
John





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

end of thread, other threads:[~2012-06-28  5:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-27 22:36 [PATCH RESEND] mips: pci-lantiq: Fix check for valid gpio Roland Stigge
2012-06-28  5:19 ` John Crispin

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.