[4/4] PM / devfreq: use delayed work if DEVFREQ_DELAYED_TIMER set
diff mbox series

Message ID 20191209144425.13321-5-k.konieczny@samsung.com
State New
Headers show
Series
  • PM / devfreq: add possibility for delayed work
Related show

Commit Message

Kamil Konieczny Dec. 9, 2019, 2:44 p.m. UTC
If option DEVFREQ_DELAYED_TIMER is set use delayed work in devfreq
workqueue from devfreq start.

Signed-off-by: Kamil Konieczny <k.konieczny@samsung.com>
---
 drivers/devfreq/devfreq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch
diff mbox series

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);