[PATCH 4/4] PM / devfreq: use delayed work if DEVFREQ_DELAYED_TIMER set
From: Kamil Konieczny
Date: Mon Dec 09 2019 - 09:44:54 EST
If option DEVFREQ_DELAYED_TIMER is set use delayed work in devfreq
workqueue from devfreq start.
Signed-off-by: Kamil Konieczny <k.konieczny@xxxxxxxxxxx>
---
drivers/devfreq/devfreq.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index c277d1770fef..d9edf648a09e 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -702,7 +702,10 @@ struct devfreq *devfreq_add_device(struct device *dev,
devfreq->last_status.current_frequency = profile->initial_freq;
devfreq->data = data;
devfreq->nb.notifier_call = devfreq_notifier_call;
- devfreq->delayed_timer = false;
+ if (IS_ENABLED(CONFIG_DEVFREQ_DELAYED_TIMER))
+ devfreq->delayed_timer = true;
+ else
+ devfreq->delayed_timer = false;
if (!devfreq->profile->max_state && !devfreq->profile->freq_table) {
mutex_unlock(&devfreq->lock);
--
2.24.0