[PATCH] clk: fix ccf_clk_get_rate

Michael Nazzareno Trimarchi michael at amarulasolutions.com
Thu Jul 25 09:31:55 CEST 2024


Hi

On Thu, Jul 25, 2024 at 9:16 AM Zhiqiang Hou <Zhiqiang.Hou at nxp.com> wrote:
>
> From: Hou Zhiqiang <Zhiqiang.Hou at nxp.com>
>
> As the type of return value is 'ulong', when clk_get_by_id() failed,
> it should return 0 to indicate the get_rate operation doesn't succeed.
>

I understand your point here but the clk_get_rate that can call the
ccf clk_get_rate
can already return -ENOSYS.

Michael

> Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou at nxp.com>
> ---
>  drivers/clk/clk.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index b8c2e8d531..4c2c372cd3 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -84,7 +84,8 @@ ulong ccf_clk_get_rate(struct clk *clk)
>         int err = clk_get_by_id(clk->id, &c);
>
>         if (err)
> -               return err;
> +               return 0;
> +
>         return clk_get_rate(c);
>  }
>
> --
> 2.17.1
>


-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael at amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info at amarulasolutions.com
www.amarulasolutions.com


More information about the U-Boot mailing list