aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/controller/dwc
diff options
context:
space:
mode:
authorHou Zhiqiang <Zhiqiang.Hou@nxp.com>2019-08-20 03:28:49 -0400
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2019-08-22 13:16:24 -0400
commit66de33f09fd97201847de7e1e2ec8a117242e1d6 (patch)
tree98b3ede054ba793b5e3f5f16b6d2363cebd6e1ef /drivers/pci/controller/dwc
parentee4ea764ea03253016034603cab352c0798ce173 (diff)
PCI: dwc: Return directly when num-lanes is not found
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>
Diffstat (limited to 'drivers/pci/controller/dwc')
-rw-r--r--drivers/pci/controller/dwc/pcie-designware.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
index 7d25102c304c..0a89bfd1636e 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -423,8 +423,10 @@ void dw_pcie_setup(struct dw_pcie *pci)
423 423
424 424
425 ret = of_property_read_u32(np, "num-lanes", &lanes); 425 ret = of_property_read_u32(np, "num-lanes", &lanes);
426 if (ret) 426 if (ret) {
427 lanes = 0; 427 dev_dbg(pci->dev, "property num-lanes isn't found\n");
428 return;
429 }
428 430
429 /* Set the number of lanes */ 431 /* Set the number of lanes */
430 val = dw_pcie_readl_dbi(pci, PCIE_PORT_LINK_CONTROL); 432 val = dw_pcie_readl_dbi(pci, PCIE_PORT_LINK_CONTROL);