]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
xilinx: zynqmp: Check return value from xilinx_pm_request()
authorMichal Simek <michal.simek@xilinx.com>
Wed, 21 Oct 2020 10:16:02 +0000 (12:16 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 27 Oct 2020 07:13:32 +0000 (08:13 +0100)
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@xilinx.com>
board/xilinx/zynqmp/zynqmp.c

index db3f5978a9289e5291cf6ac346509c5939b1b1ac..e658245408090a11a12f14243301d90994177dd2 100644 (file)
@@ -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: