diff mbox series

firmware: xilinx: check return value of zynqmp_pm_get_api_version()

Message ID 1633509835-31949-1-git-send-email-rajan.vaja@xilinx.com (mailing list archive)
State New, archived
Headers show
Series firmware: xilinx: check return value of zynqmp_pm_get_api_version() | expand

Commit Message

Rajan Vaja Oct. 6, 2021, 8:43 a.m. UTC
Currently return value of zynqmp_pm_get_api_version() is ignored.
Because of that, API version is checked in case of error also.
So add check for return value of zynqmp_pm_get_api_version().

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
---
 drivers/firmware/xilinx/zynqmp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Michal Simek Oct. 6, 2021, 8:53 a.m. UTC | #1
On 10/6/21 10:43 AM, Rajan Vaja wrote:
> Currently return value of zynqmp_pm_get_api_version() is ignored.
> Because of that, API version is checked in case of error also.
> So add check for return value of zynqmp_pm_get_api_version().
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
>  drivers/firmware/xilinx/zynqmp.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
> index a3cadba..070197e 100644
> --- a/drivers/firmware/xilinx/zynqmp.c
> +++ b/drivers/firmware/xilinx/zynqmp.c
> @@ -1371,7 +1371,10 @@ static int zynqmp_firmware_probe(struct platform_device *pdev)
>  		return ret;
>  
>  	/* Check PM API version number */
> -	zynqmp_pm_get_api_version(&pm_api_version);
> +	ret = zynqmp_pm_get_api_version(&pm_api_version);
> +	if (ret)
> +		return ret;
> +
>  	if (pm_api_version < ZYNQMP_PM_VERSION) {
>  		panic("%s Platform Management API version error. Expected: v%d.%d - Found: v%d.%d\n",
>  		      __func__,
> 

Reviewed-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal
Michal Simek Oct. 18, 2021, 1:14 p.m. UTC | #2
On 10/6/21 10:43, Rajan Vaja wrote:
> Currently return value of zynqmp_pm_get_api_version() is ignored.
> Because of that, API version is checked in case of error also.
> So add check for return value of zynqmp_pm_get_api_version().
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
>   drivers/firmware/xilinx/zynqmp.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
> index a3cadba..070197e 100644
> --- a/drivers/firmware/xilinx/zynqmp.c
> +++ b/drivers/firmware/xilinx/zynqmp.c
> @@ -1371,7 +1371,10 @@ static int zynqmp_firmware_probe(struct platform_device *pdev)
>   		return ret;
>   
>   	/* Check PM API version number */
> -	zynqmp_pm_get_api_version(&pm_api_version);
> +	ret = zynqmp_pm_get_api_version(&pm_api_version);
> +	if (ret)
> +		return ret;
> +
>   	if (pm_api_version < ZYNQMP_PM_VERSION) {
>   		panic("%s Platform Management API version error. Expected: v%d.%d - Found: v%d.%d\n",
>   		      __func__,
> 

Applied.
M
diff mbox series

Patch

diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
index a3cadba..070197e 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -1371,7 +1371,10 @@  static int zynqmp_firmware_probe(struct platform_device *pdev)
 		return ret;
 
 	/* Check PM API version number */
-	zynqmp_pm_get_api_version(&pm_api_version);
+	ret = zynqmp_pm_get_api_version(&pm_api_version);
+	if (ret)
+		return ret;
+
 	if (pm_api_version < ZYNQMP_PM_VERSION) {
 		panic("%s Platform Management API version error. Expected: v%d.%d - Found: v%d.%d\n",
 		      __func__,