[PATCH 5/6] clk: Remove an unneeded check from clk_get_parent_rate()

Sean Anderson seanga2 at gmail.com
Mon Feb 20 17:12:12 CET 2023


On 2/20/23 00:59, Samuel Holland wrote:
> There is no need to check the parent clock's ops. The following call to
> clk_get_rate() does that already.
> 
> Signed-off-by: Samuel Holland <samuel at sholland.org>
> ---
> 
>   drivers/clk/clk-uclass.c | 5 -----
>   1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
> index 9d052e5a814..53cfd819779 100644
> --- a/drivers/clk/clk-uclass.c
> +++ b/drivers/clk/clk-uclass.c
> @@ -504,7 +504,6 @@ struct clk *clk_get_parent(struct clk *clk)
>   
>   ulong clk_get_parent_rate(struct clk *clk)
>   {
> -	const struct clk_ops *ops;
>   	struct clk *pclk;
>   
>   	debug("%s(clk=%p)\n", __func__, clk);
> @@ -515,10 +514,6 @@ ulong clk_get_parent_rate(struct clk *clk)
>   	if (IS_ERR(pclk))
>   		return -ENODEV;
>   
> -	ops = clk_dev_ops(pclk->dev);
> -	if (!ops->get_rate)
> -		return -ENOSYS;
> -
>   	/* Read the 'rate' if not already set or if proper flag set*/
>   	if (!pclk->rate || IS_ERR_VALUE(pclk->rate) ||
>   	    pclk->flags & CLK_GET_RATE_NOCACHE)

Reviewed-by: Sean Anderson <seanga2 at gmail.com>


More information about the U-Boot mailing list