Skip to content

Commit 42b14cb

Browse files
stiggelinusw
authored andcommitted
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 <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 3996bfc commit 42b14cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/mips/pci/pci-lantiq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static int __devinit ltq_pci_startup(struct platform_device *pdev)
129129

130130
/* setup reset gpio used by pci */
131131
reset_gpio = of_get_named_gpio(node, "gpio-reset", 0);
132-
if (reset_gpio > 0)
132+
if (gpio_is_valid(reset_gpio))
133133
devm_gpio_request(&pdev->dev, reset_gpio, "pci-reset");
134134

135135
/* enable auto-switching between PCI and EBU */
@@ -192,7 +192,7 @@ static int __devinit ltq_pci_startup(struct platform_device *pdev)
192192
ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_PCC_IEN) | 0x10, LTQ_EBU_PCC_IEN);
193193

194194
/* toggle reset pin */
195-
if (reset_gpio > 0) {
195+
if (gpio_is_valid(reset_gpio)) {
196196
__gpio_set_value(reset_gpio, 0);
197197
wmb();
198198
mdelay(1);

0 commit comments

Comments
 (0)