]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
drivers: firmware: Handle error case in the zynqmp_pm_feature
authorVenkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Wed, 11 Oct 2023 02:56:47 +0000 (08:26 +0530)
committerMichal Simek <michal.simek@amd.com>
Tue, 7 Nov 2023 12:47:08 +0000 (13:47 +0100)
Unhandled error coming from xilinx_pm_request() but return
value is not read back that's why getting sparse warning
as below:
warning: variable 'ret' set but not used [-Wunused-but-set-variable].
In case of error return the "ret" value.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20231011025647.17200-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
drivers/firmware/firmware-zynqmp.c

index 43fb7fa7787e5ef62b5bc3ff521bc9bcf35cdafd..8ea15c7ed3390c40351817a68ac769cff75ceaff 100644 (file)
@@ -203,6 +203,8 @@ int zynqmp_pm_feature(const u32 api_id)
        /* Check feature check API version */
        ret = xilinx_pm_request(PM_FEATURE_CHECK, api_id, 0, 0, 0,
                                ret_payload);
+       if (ret)
+               return ret;
 
        /* Return feature check version */
        return ret_payload[1] & FIRMWARE_VERSION_MASK;