Re: [PATCH v2 1/4] PM / devfreq: Fall back to previous_freq when get_cur_freq() fails

From: Bean Huo

Date: Mon Nov 16 2026 - 09:01:30 EST


On Sun, 2026-11-15 at 09:25 +0900, Choi Chanwoo wrote:
> > -       else
> > +       if (!devfreq->profile->get_cur_freq ||
> > +           devfreq->profile->get_cur_freq(devfreq->dev.parent, &cur_freq))
> >                 cur_freq = devfreq->previous_freq;
> >  
> >         freqs.old = cur_freq;
>
> I agree this patch.
> But, I don't recommend to execute to function on if statement.
> In order to improve the readability, could you please update it as following:
>
>         unsigned long cur_freq = devfreq->previous_freq;
>         unsigned long freq;
>         ...
>         if (devfreq->profile->get_cur_freq) {
>                 err = devfreq->profile->get_cur_freq(devfreq->dev.parent,
> &freq);
>                 if (!err)
>                         cur_freq = freq;
>         }
>
> --
> Best Regards,
> Chanwoo Choi
> Principal Engineer, Samsung Electronics

Chanwoo,

thanks, will update these two patches only since UFS patches have been merged.

Kind regards, 
Bean