[PATCH] arm64: zynqmp: Fix return code from do_zynqmp_pmufw()

Michal Simek michal.simek at amd.com
Thu Jun 8 13:38:13 CEST 2023



On 6/1/23 13:25, Michal Simek wrote:
> zynqmp_pmufw_node() can also return values like -ENODEV which means that
> NODE has been already configured that's why don't propagate this error
> code.
> 
> Signed-off-by: Michal Simek <michal.simek at amd.com>
> ---
> 
> The same technique was used on power domain driver by this patch
> https://lore.kernel.org/r/20230523124215.30915-3-stefan.herbrechtsmeier-oss@weidmueller.com
> 
> ---
>   board/xilinx/zynqmp/cmds.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/board/xilinx/zynqmp/cmds.c b/board/xilinx/zynqmp/cmds.c
> index 9d375b075501..930592ffb5c1 100644
> --- a/board/xilinx/zynqmp/cmds.c
> +++ b/board/xilinx/zynqmp/cmds.c
> @@ -211,6 +211,7 @@ static int do_zynqmp_pmufw(struct cmd_tbl *cmdtp, int flag, int argc,
>   
>   	if (!strncmp(argv[2], "node", 4)) {
>   		u32 id;
> +		int ret;
>   
>   		if (!strncmp(argv[3], "close", 5))
>   			return zynqmp_pmufw_config_close();
> @@ -223,7 +224,11 @@ static int do_zynqmp_pmufw(struct cmd_tbl *cmdtp, int flag, int argc,
>   
>   		printf("Enable permission for node ID %d\n", id);
>   
> -		return zynqmp_pmufw_node(id);
> +		ret = zynqmp_pmufw_node(id);
> +		if (ret == -ENODEV)
> +			ret = 0;
> +
> +		return ret;
>   	}
>   
>   	addr = hextoul(argv[2], NULL);

Applied.
M


More information about the U-Boot mailing list