From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Z.q. Hou" Subject: [PATCHv2 2/4] PCI: dwc: Return directly when num-lanes is not found Date: Tue, 20 Aug 2019 07:28:49 +0000 Message-ID: <20190820073022.24217-3-Zhiqiang.Hou@nxp.com> References: <20190820073022.24217-1-Zhiqiang.Hou@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20190820073022.24217-1-Zhiqiang.Hou@nxp.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: "linux-pci@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "gustavo.pimentel@synopsys.com" , "jingoohan1@gmail.com" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "andrew.murray@arm.com" Cc: "M.h. Lian" , "Z.q. Hou" List-Id: devicetree@vger.kernel.org From: Hou Zhiqiang The num-lanes is optional, so probably it isn't added on some platforms. The subsequent programming is base on the num-lanes, hence return when it is not found. Signed-off-by: Hou Zhiqiang Reviewed-by: Andrew Murray --- V2: - No change. drivers/pci/controller/dwc/pcie-designware.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/con= troller/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) =20 =20 ret =3D of_property_read_u32(np, "num-lanes", &lanes); - if (ret) - lanes =3D 0; + if (ret) { + dev_dbg(pci->dev, "property num-lanes isn't found\n"); + return; + } =20 /* Set the number of lanes */ val =3D dw_pcie_readl_dbi(pci, PCIE_PORT_LINK_CONTROL); --=20 2.17.1