[U-Boot] [PATCH v4 03/13] clk: Remove clock ID check in .get_rate() of clk_fixed_*
Stefano Babic
sbabic at denx.de
Sat Jun 8 15:22:00 UTC 2019
On 17/05/19 00:10, Lukasz Majewski wrote:
> This check requires the struct clk passed to .get_rate() to be always
> cleared out as any clock with valid ID causes -EINVAL return value.
>
> The return code of fixed clocks shall always be returned.
>
> Signed-off-by: Lukasz Majewski <lukma at denx.de>
>
> ---
>
> Changes in v4:
> - None
>
> Changes in v3: None
>
> drivers/clk/clk_fixed_factor.c | 3 ---
> drivers/clk/clk_fixed_rate.c | 3 ---
> 2 files changed, 6 deletions(-)
>
> diff --git a/drivers/clk/clk_fixed_factor.c b/drivers/clk/clk_fixed_factor.c
> index 5fa20a84db..dcdb6ddf5c 100644
> --- a/drivers/clk/clk_fixed_factor.c
> +++ b/drivers/clk/clk_fixed_factor.c
> @@ -24,9 +24,6 @@ static ulong clk_fixed_factor_get_rate(struct clk *clk)
> uint64_t rate;
> struct clk_fixed_factor *ff = to_clk_fixed_factor(clk->dev);
>
> - if (clk->id != 0)
> - return -EINVAL;
> -
> rate = clk_get_rate(&ff->parent);
> if (IS_ERR_VALUE(rate))
> return rate;
> diff --git a/drivers/clk/clk_fixed_rate.c b/drivers/clk/clk_fixed_rate.c
> index d8d9f86c86..50dbb13655 100644
> --- a/drivers/clk/clk_fixed_rate.c
> +++ b/drivers/clk/clk_fixed_rate.c
> @@ -15,9 +15,6 @@ struct clk_fixed_rate {
>
> static ulong clk_fixed_rate_get_rate(struct clk *clk)
> {
> - if (clk->id != 0)
> - return -EINVAL;
> -
> return to_clk_fixed_rate(clk->dev)->fixed_rate;
> }
>
>
Reviewed-by: Stefano Babic <sbabic at denx.de>
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
More information about the U-Boot
mailing list