PM / devfreq: Use more accurate returned new_freq as resume_freq
authorDong Aisheng <aisheng.dong@nxp.com>
Tue, 23 Mar 2021 07:20:08 +0000 (15:20 +0800)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 8 Apr 2021 04:14:45 +0000 (13:14 +0900)
Use the more accurate returned new_freq as resume_freq.
It's the same as how devfreq->previous_freq was updated.

Fixes: 83f8ca45afbf0 ("PM / devfreq: add support for suspend/resume of a devfreq device")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/devfreq/devfreq.c

index 99b2eee..fe08c46 100644 (file)
@@ -388,7 +388,7 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq,
        devfreq->previous_freq = new_freq;
 
        if (devfreq->suspend_freq)
-               devfreq->resume_freq = cur_freq;
+               devfreq->resume_freq = new_freq;
 
        return err;
 }