Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hou Zhiqiang and committed by
Lorenzo Pieralisi
66de33f0 ee4ea764

+4 -2
+4 -2
drivers/pci/controller/dwc/pcie-designware.c
··· 423 423 424 424 425 425 ret = of_property_read_u32(np, "num-lanes", &lanes); 426 - if (ret) 427 - lanes = 0; 426 + if (ret) { 427 + dev_dbg(pci->dev, "property num-lanes isn't found\n"); 428 + return; 429 + } 428 430 429 431 /* Set the number of lanes */ 430 432 val = dw_pcie_readl_dbi(pci, PCIE_PORT_LINK_CONTROL);