mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
devfreq: Fix PM callbacks to support zero frequency
It is perfectly valid for a device to have a zero frequency, usually it denotes a power collapse. To support this, fix the PM suspend callback to allow the suspend_freq to be zero. Change-Id: Id10f95b59b219e82e0695f80361aa6b35cdc5137 Signed-off-by: Shreyas K K <shrekk@codeaurora.org>
This commit is contained in:
parent
01674892a6
commit
6024e3974b
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)
|
||||
if (devfreq->suspend_freq >= 0)
|
||||
devfreq->resume_freq = new_freq;
|
||||
|
||||
return err;
|
||||
|
|
@ -912,7 +912,7 @@ int devfreq_suspend_device(struct devfreq *devfreq)
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (devfreq->suspend_freq) {
|
||||
if (devfreq->suspend_freq >= 0) {
|
||||
mutex_lock(&devfreq->lock);
|
||||
ret = devfreq_set_target(devfreq, devfreq->suspend_freq, 0);
|
||||
mutex_unlock(&devfreq->lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue