Commit 42b14cb0 authored by Roland Stigge's avatar Roland Stigge Committed by Linus Walleij

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: default avatarRoland Stigge <stigge@antcom.de>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 3996bfc7
...@@ -129,7 +129,7 @@ static int __devinit ltq_pci_startup(struct platform_device *pdev) ...@@ -129,7 +129,7 @@ static int __devinit ltq_pci_startup(struct platform_device *pdev)
/* setup reset gpio used by pci */ /* setup reset gpio used by pci */
reset_gpio = of_get_named_gpio(node, "gpio-reset", 0); 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"); devm_gpio_request(&pdev->dev, reset_gpio, "pci-reset");
/* enable auto-switching between PCI and EBU */ /* enable auto-switching between PCI and EBU */
...@@ -192,7 +192,7 @@ static int __devinit ltq_pci_startup(struct platform_device *pdev) ...@@ -192,7 +192,7 @@ static int __devinit ltq_pci_startup(struct platform_device *pdev)
ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_PCC_IEN) | 0x10, LTQ_EBU_PCC_IEN); ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_PCC_IEN) | 0x10, LTQ_EBU_PCC_IEN);
/* toggle reset pin */ /* toggle reset pin */
if (reset_gpio > 0) { if (gpio_is_valid(reset_gpio)) {
__gpio_set_value(reset_gpio, 0); __gpio_set_value(reset_gpio, 0);
wmb(); wmb();
mdelay(1); mdelay(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment