[PATCH] clk: versal: Return error in case if clock setup failed

Michal Simek michal.simek at amd.com
Mon Jan 16 15:34:04 CET 2023



On 1/10/23 08:23, Michal Simek wrote:
> From: Jay Buddhabhatti <jay.buddhabhatti at xilinx.com>
> 
> Currently probe is getting success even if clock setup is failed
> because of that u-boot is trying to access invalid clocks. So return
> error if clock setup failed.
> 
> Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti at xilinx.com>
> Signed-off-by: Michal Simek <michal.simek at amd.com>
> ---
> 
>   drivers/clk/clk_versal.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/clk_versal.c b/drivers/clk/clk_versal.c
> index 76fde00491b2..faebbab1c6d3 100644
> --- a/drivers/clk/clk_versal.c
> +++ b/drivers/clk/clk_versal.c
> @@ -657,7 +657,9 @@ static int versal_clk_probe(struct udevice *dev)
>   	if (ret < 0)
>   		return -EINVAL;
>   
> -	versal_clock_setup();
> +	ret = versal_clock_setup();
> +	if (ret < 0)
> +		return ret;
>   
>   	priv->clk = clock;
>   

Applied.
M


More information about the U-Boot mailing list