[PATCH] clk: spacemit: ccu_pll: fix error return value in recalc_rate callback

Akhilesh Patil akhilesh at ee.iitb.ac.in
Tue Jul 22 22:37:36 PDT 2025


On Tue, Jul 22, 2025 at 01:08:30AM +0000, Haylen Chu wrote:
> On Tue, Jul 22, 2025 at 12:37:10AM +0530, Akhilesh Patil wrote:
> > Return 0 instead of -EINVAL if function ccu_pll_recalc_rate() fails to
> > get correct rate entry. Follow .recalc_rate callback documentation
> > as mentioned in include/linux/clk-provider.h for error return value.
> 
> Nice catch, thanks.
> 
> > Signed-off-by: Akhilesh Patil <akhilesh at ee.iitb.ac.in>
> 
> Here misses a Fixes tag. With this added,
> 
> Reviewed-by: Haylen Chu <heylenay at 4d2.org>
> 
Thanks Haylen and Alex for the review. Sent V2 patch with Fixes tag.

> > ---
> >  drivers/clk/spacemit/ccu_pll.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/clk/spacemit/ccu_pll.c b/drivers/clk/spacemit/ccu_pll.c
> > index 4427dcfbbb97..45f540073a65 100644
> > --- a/drivers/clk/spacemit/ccu_pll.c
> > +++ b/drivers/clk/spacemit/ccu_pll.c
> > @@ -122,7 +122,7 @@ static unsigned long ccu_pll_recalc_rate(struct clk_hw *hw,
> >  
> >  	WARN_ON_ONCE(!entry);
> >  
> > -	return entry ? entry->rate : -EINVAL;
> > +	return entry ? entry->rate : 0;
> >  }
> >  
> >  static long ccu_pll_round_rate(struct clk_hw *hw, unsigned long rate,
> > -- 
> > 2.34.1
> > 



More information about the linux-riscv mailing list