summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-08-20 07:28:49 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2019-11-27 12:17:38 +0100
commitaff117c41f5eaa3157b70ab9cf2a60b6fe75e7bf (patch)
treef0bd570c033816291d46c989beafd09b64e021f2
parentcbd3f218fd4326ffe22a9e967b2060c0dcc7ea2c (diff)
downloadbarebox-aff117c41f5eaa3157b70ab9cf2a60b6fe75e7bf.tar.gz
barebox-aff117c41f5eaa3157b70ab9cf2a60b6fe75e7bf.tar.xz
PCI: dwc: Return directly when num-lanes is not found
Port of Linux commit 66de33f09fd97201847de7e1e2ec8a117242e1d6 The num-lanes is optional since it is not needed on some platforms that bring up the link in firmware. The link programming is based on the num-lanes properties (which is optional); if it is not present code must return instead of fiddling with the lanes value to print an error message. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Andrew Murray <andrew.murray@arm.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/pci/pcie-designware.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/pcie-designware.c b/drivers/pci/pcie-designware.c
index 72deeee4ed..e2007dba6d 100644
--- a/drivers/pci/pcie-designware.c
+++ b/drivers/pci/pcie-designware.c
@@ -295,8 +295,10 @@ void dw_pcie_setup(struct dw_pcie *pci)
ret = of_property_read_u32(np, "num-lanes", &lanes);
- if (ret)
- lanes = 0;
+ if (ret) {
+ dev_dbg(pci->dev, "property num-lanes isn't found\n");
+ return;
+ }
/* Set the number of lanes */
val = dw_pcie_readl_dbi(pci, PCIE_PORT_LINK_CONTROL);