diff options
author | Roland Stigge <stigge@antcom.de> | 2012-06-18 05:28:26 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-07-05 09:02:18 -0400 |
commit | 42b14cb037fefa33a2ff51c4d3915a49c71de3d5 (patch) | |
tree | 5accb630636ab2ce17de936e694bc3404b6fed55 /arch | |
parent | 3996bfc787a3b3d7c7ad97b7519247f9f2ac4068 (diff) |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/pci/pci-lantiq.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mips/pci/pci-lantiq.c b/arch/mips/pci/pci-lantiq.c index ea453532a33c..075d87acd12a 100644 --- a/arch/mips/pci/pci-lantiq.c +++ b/arch/mips/pci/pci-lantiq.c | |||
@@ -129,7 +129,7 @@ static int __devinit ltq_pci_startup(struct platform_device *pdev) | |||
129 | 129 | ||
130 | /* setup reset gpio used by pci */ | 130 | /* setup reset gpio used by pci */ |
131 | reset_gpio = of_get_named_gpio(node, "gpio-reset", 0); | 131 | reset_gpio = of_get_named_gpio(node, "gpio-reset", 0); |
132 | if (reset_gpio > 0) | 132 | if (gpio_is_valid(reset_gpio)) |
133 | devm_gpio_request(&pdev->dev, reset_gpio, "pci-reset"); | 133 | devm_gpio_request(&pdev->dev, reset_gpio, "pci-reset"); |
134 | 134 | ||
135 | /* enable auto-switching between PCI and EBU */ | 135 | /* enable auto-switching between PCI and EBU */ |
@@ -192,7 +192,7 @@ static int __devinit ltq_pci_startup(struct platform_device *pdev) | |||
192 | ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_PCC_IEN) | 0x10, LTQ_EBU_PCC_IEN); | 192 | ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_PCC_IEN) | 0x10, LTQ_EBU_PCC_IEN); |
193 | 193 | ||
194 | /* toggle reset pin */ | 194 | /* toggle reset pin */ |
195 | if (reset_gpio > 0) { | 195 | if (gpio_is_valid(reset_gpio)) { |
196 | __gpio_set_value(reset_gpio, 0); | 196 | __gpio_set_value(reset_gpio, 0); |
197 | wmb(); | 197 | wmb(); |
198 | mdelay(1); | 198 | mdelay(1); |