[PATCH] clk: sifive: check wrpll_configure_for_rate() return value
Sean Anderson
seanga2 at gmail.com
Thu Apr 11 05:13:52 CEST 2024
On 2/16/24 12:06, Heinrich Schuchardt wrote:
> wrpll_configure_for_rate() might fail. We should check the return value.
>
> Fixes: d56d79ed27c6 ("drivers: clk: add fu740 support")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
> drivers/clk/sifive/sifive-prci.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c
> index c8fb6002907..a950736f11b 100644
> --- a/drivers/clk/sifive/sifive-prci.c
> +++ b/drivers/clk/sifive/sifive-prci.c
> @@ -209,7 +209,9 @@ unsigned long sifive_prci_wrpll_round_rate(struct __prci_clock *pc,
>
> memcpy(&c, &pwd->c, sizeof(c));
>
> - wrpll_configure_for_rate(&c, rate, *parent_rate);
> + r = wrpll_configure_for_rate(&c, rate, *parent_rate);
> + if (r)
> + return r;
>
> return wrpll_calc_output_rate(&c, *parent_rate);
> }
Reviewed-by: Sean Anderson <seanga2 at gmail.com>
More information about the U-Boot
mailing list