diff mbox series

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

Message ID 20191209144425.13321-5-k.konieczny@samsung.com (mailing list archive)
State New, archived
Headers show
Series PM / devfreq: add possibility for delayed work | expand

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(-)
diff mbox series

Patch

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