Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66de33f0 authored by Hou Zhiqiang's avatar Hou Zhiqiang Committed by Lorenzo Pieralisi
Browse files

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: default avatarHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: default avatarAndrew Murray <andrew.murray@arm.com>
parent ee4ea764
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -423,8 +423,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);