Commit 42b14cb037fefa33a2ff51c4d3915a49c71de3d5

Authored by Roland Stigge
Committed by Linus Walleij
1 parent 3996bfc787

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@antcom.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

arch/mips/pci/pci-lantiq.c
... ... @@ -129,7 +129,7 @@
129 129  
130 130 /* setup reset gpio used by pci */
131 131 reset_gpio = of_get_named_gpio(node, "gpio-reset", 0);
132   - if (reset_gpio > 0)
  132 + if (gpio_is_valid(reset_gpio))
133 133 devm_gpio_request(&pdev->dev, reset_gpio, "pci-reset");
134 134  
135 135 /* enable auto-switching between PCI and EBU */
... ... @@ -192,7 +192,7 @@
192 192 ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_PCC_IEN) | 0x10, LTQ_EBU_PCC_IEN);
193 193  
194 194 /* toggle reset pin */
195   - if (reset_gpio > 0) {
  195 + if (gpio_is_valid(reset_gpio)) {
196 196 __gpio_set_value(reset_gpio, 0);
197 197 wmb();
198 198 mdelay(1);