mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
devfreq: Fix suspend callback for non-zero min_freq
With commit commit 921884ca1498 ("devfreq: Fix PM
callbacks to support zero frequency"), suspend_freq
of zero is considered valid.
However, the devfreq_set_target is called with zero frequency.
To avoid this, do not call devfreq_set_target if the
suspend_freq is less than the minimun allowed frequency.
Change-Id: I506165d28395eb67138ae2dac53e842357809bbb
Signed-off-by: Shreyas K K <shrekk@codeaurora.org>
This commit is contained in:
parent
6024e3974b
commit
0192aaa6cd
1 changed files with 2 additions and 2 deletions
|
|
@ -318,7 +318,7 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq,
|
|||
|
||||
devfreq->previous_freq = new_freq;
|
||||
|
||||
if (devfreq->suspend_freq >= 0)
|
||||
if (devfreq->suspend_freq >= devfreq->scaling_min_freq)
|
||||
devfreq->resume_freq = new_freq;
|
||||
|
||||
return err;
|
||||
|
|
@ -912,7 +912,7 @@ int devfreq_suspend_device(struct devfreq *devfreq)
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (devfreq->suspend_freq >= 0) {
|
||||
if (devfreq->suspend_freq >= devfreq->scaling_min_freq) {
|
||||
mutex_lock(&devfreq->lock);
|
||||
ret = devfreq_set_target(devfreq, devfreq->suspend_freq, 0);
|
||||
mutex_unlock(&devfreq->lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue