1 From b6684dd3036513e4f91986fe982356512458f711 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Sat, 19 Jan 2013 08:54:26 +0000
4 Subject: [PATCH 18/40] MIPS: lantiq: improve pci reset gpio handling
6 We need to make sure that the reset gpio is available and also set a sane
9 Signed-off-by: John Crispin <blogic@openwrt.org>
10 Patchwork: http://patchwork.linux-mips.org/patch/4817/
12 arch/mips/pci/pci-lantiq.c | 12 ++++++++++--
13 1 file changed, 10 insertions(+), 2 deletions(-)
15 diff --git a/arch/mips/pci/pci-lantiq.c b/arch/mips/pci/pci-lantiq.c
16 index 9568178..f32664b 100644
17 --- a/arch/mips/pci/pci-lantiq.c
18 +++ b/arch/mips/pci/pci-lantiq.c
19 @@ -129,8 +129,16 @@ static int ltq_pci_startup(struct platform_device *pdev)
21 /* setup reset gpio used by pci */
22 reset_gpio = of_get_named_gpio(node, "gpio-reset", 0);
23 - if (gpio_is_valid(reset_gpio))
24 - devm_gpio_request(&pdev->dev, reset_gpio, "pci-reset");
25 + if (gpio_is_valid(reset_gpio)) {
26 + int ret = devm_gpio_request(&pdev->dev,
27 + reset_gpio, "pci-reset");
30 + "failed to request gpio %d\n", reset_gpio);
33 + gpio_direction_output(reset_gpio, 1);
36 /* enable auto-switching between PCI and EBU */
37 ltq_pci_w32(0xa, PCI_CR_CLK_CTRL);