[PATCH 1/4] xilinx: zynqmp: Check return value from xilinx_pm_request()

Michal Simek michal.simek at xilinx.com
Wed Oct 21 12:29:16 CEST 2020


xilinx_pm_request() can failed that's why also check return value.

Fixes: 050f10f103cd ("xilinx: zynqmp: remove chip_id function")
Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 board/xilinx/zynqmp/zynqmp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index db3f5978a928..e65824540809 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -192,7 +192,11 @@ static char *zynqmp_get_silicon_idcode_name(void)
 	u32 ret_payload[PAYLOAD_ARG_CNT];
 	int ret;
 
-	xilinx_pm_request(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload);
+	ret = xilinx_pm_request(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload);
+	if (ret) {
+		debug("%s: Getting chipid failed\n", __func__);
+		return "unknown";
+	}
 
 	/*
 	 * Firmware returns:
-- 
2.28.0



More information about the U-Boot mailing list