summaryrefslogtreecommitdiff
path: root/drivers/devfreq/devfreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/devfreq/devfreq.c')
-rw-r--r--drivers/devfreq/devfreq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 24ddf13214f0..bc6623f13ab5 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -1001,7 +1001,7 @@ static ssize_t available_frequencies_show(struct device *d,
rcu_read_lock();
use_opp = dev_pm_opp_get_opp_count(dev) > 0;
- do {
+ while (use_opp || (!use_opp && i < max_state)) {
if (use_opp) {
opp = dev_pm_opp_find_freq_ceil(dev, &freq);
if (IS_ERR(opp))
@@ -1013,7 +1013,7 @@ static ssize_t available_frequencies_show(struct device *d,
count += scnprintf(&buf[count], (PAGE_SIZE - count - 2),
"%lu ", freq);
freq++;
- } while (use_opp || (!use_opp && i < max_state));
+ }
rcu_read_unlock();
/* Truncate the trailing space */