[U-Boot] [PATCH 1/2] pci: imx: Adjust the return value when imx_pcie_addr_valid() fails

Bin Meng bmeng.cn at gmail.com
Fri Jan 8 10:03:20 CET 2016


When trying to access non-existent/unsupported PCI devices in
imx_pcie_read_config(), when imx_pcie_addr_valid() fails it returns
error code and fills in the result with 0xffffffff manually. But it
really should return zero to upper layer codes.

Reported-by: Fabio Estevam <fabio.estevam at nxp.com>
Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
Tested-by: Fabio Estevam <fabio.estevam at nxp.com>
---

 drivers/pci/pcie_imx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pcie_imx.c b/drivers/pci/pcie_imx.c
index f1e189e..c14bb0a 100644
--- a/drivers/pci/pcie_imx.c
+++ b/drivers/pci/pcie_imx.c
@@ -381,7 +381,7 @@ static int imx_pcie_read_config(struct pci_controller *hose, pci_dev_t d,
 	ret = imx_pcie_addr_valid(d);
 	if (ret) {
 		*val = 0xffffffff;
-		return ret;
+		return 0;
 	}
 
 	va_address = get_bus_address(d, where);
-- 
1.7.9.5



More information about the U-Boot mailing list