summaryrefslogtreecommitdiff
path: root/target/linux/lantiq/patches-3.7/0124-pci_fix.patch
blob: 013dac76cb57aff6dcdc46358155fa2f5658077d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Index: linux-3.7-rc8/arch/mips/pci/pci-lantiq.c
===================================================================
--- linux-3.7-rc8.orig/arch/mips/pci/pci-lantiq.c	2012-12-03 20:22:37.000000000 +0100
+++ linux-3.7-rc8/arch/mips/pci/pci-lantiq.c	2012-12-14 23:28:24.355606776 +0100
@@ -129,8 +129,15 @@
 
 	/* setup reset gpio used by pci */
 	reset_gpio = of_get_named_gpio(node, "gpio-reset", 0);
-	if (gpio_is_valid(reset_gpio))
-		devm_gpio_request(&pdev->dev, reset_gpio, "pci-reset");
+	if (gpio_is_valid(reset_gpio)) {
+		int ret = devm_gpio_request(&pdev->dev, reset_gpio, "pci-reset");
+		if (ret) {
+			dev_err(&pdev->dev,
+				"failed to request gpio %d\n", reset_gpio);
+			return ret;
+		}
+		gpio_direction_output(reset_gpio, 1);
+	}
 
 	/* enable auto-switching between PCI and EBU */
 	ltq_pci_w32(0xa, PCI_CR_CLK_CTRL);