lkml.org 
[lkml]   [2018]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] pci: dwc: add a check for resetting gpio
Date
devm_gpio_request_one() could fail. The fix checks its status and issues
an error if it fails.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
drivers/pci/controller/dwc/pci-exynos.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/controller/dwc/pci-exynos.c b/drivers/pci/controller/dwc/pci-exynos.c
index cee5f2f590e2..e3a045e215d2 100644
--- a/drivers/pci/controller/dwc/pci-exynos.c
+++ b/drivers/pci/controller/dwc/pci-exynos.c
@@ -226,9 +226,12 @@ static void exynos_pcie_assert_reset(struct exynos_pcie *ep)
struct dw_pcie *pci = ep->pci;
struct device *dev = pci->dev;

- if (ep->reset_gpio >= 0)
- devm_gpio_request_one(dev, ep->reset_gpio,
- GPIOF_OUT_INIT_HIGH, "RESET");
+ if (ep->reset_gpio >= 0) {
+ if (devm_gpio_request_one(dev, ep->reset_gpio,
+ GPIOF_OUT_INIT_HIGH, "RESET"))
+ dev_err(dev, "Failed requesting reset gpio %d\n",
+ ep->reset_gpio);
+ }
}

static int exynos_pcie_establish_link(struct exynos_pcie *ep)
--
2.17.2 (Apple Git-113)
\
 
 \ /
  Last update: 2018-12-26 03:24    [W:0.043 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site