Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1272923

[PATCH 6/6] PM / devfreq: Set the min_freq and max_freq of devfreq device

From Chanwoo Choi <cw00.choi@samsung.com>
Newsgroups linux.kernel
Subject [PATCH 6/6] PM / devfreq: Set the min_freq and max_freq of devfreq device
Date 2015-11-19 09:20 +0100
Message-ID <qwsBJ-6MQ-25@gated-at.bofh.it> (permalink)
References <qwsBI-6MQ-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


After probing the devfreq device driver, the value of both min_freq and
max_freq are zero(0). So, this patch initializes the 'min_freq' and 'max_freq'
field of devfreq device by using the freq_table array.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/devfreq.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index c292ceb7ff19..0b24ae7b7a48 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -121,6 +121,11 @@ static void devfreq_set_freq_table(struct devfreq *devfreq)
 		profile->freq_table[i] = freq;
 	}
 	rcu_read_unlock();
+
+	mutex_lock(&devfreq->lock);
+	devfreq->min_freq = profile->freq_table[0];
+	devfreq->max_freq = profile->freq_table[profile->max_state - 1];
+	mutex_unlock(&devfreq->lock);
 }
 
 /**
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] PM / devfreq: Clean code and add set the freq_table array Chanwoo Choi <cw00.choi@samsung.com> - 2015-11-19 09:20 +0100
  [PATCH 5/6] PM / devfreq: Modify the indentation of trans_stat sysfs  for readability Chanwoo Choi <cw00.choi@samsung.com> - 2015-11-19 09:20 +0100
  [PATCH 6/6] PM / devfreq: Set the min_freq and max_freq of devfreq  device Chanwoo Choi <cw00.choi@samsung.com> - 2015-11-19 09:20 +0100
  [PATCH 2/6] PM / devfreq: event: Fix the error and warning from  script/checkpatch.pl Chanwoo Choi <cw00.choi@samsung.com> - 2015-11-19 09:30 +0100

csiph-web