[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210929044254.38301-4-samuel@sholland.org>
Date: Tue, 28 Sep 2021 23:42:47 -0500
From: Samuel Holland <samuel@...lland.org>
To: MyungJoo Ham <myungjoo.ham@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
Chanwoo Choi <cw00.choi@...sung.com>,
Maxime Ripard <mripard@...nel.org>,
Chen-Yu Tsai <wens@...e.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Rob Herring <robh+dt@...nel.org>
Cc: Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-pm@...r.kernel.org,
linux-sunxi@...ts.linux.dev, linux-kernel@...r.kernel.org,
Samuel Holland <samuel@...lland.org>
Subject: [PATCH 03/10] PM / devfreq: Drop code for descending freq_table
Since commit 416b46a2627a ("PM / devfreq: Show the all available
frequencies"), freq_table's documentation requires it to be sorted in
ascending order. That commit modified available_frequencies_show() to
assume that order. This is also the order used by all existing drivers
and by set_freq_table().
However, there is still some code left over for compatibility with a
freq_table sorted descending. To avoid confusion, let's remove it.
Signed-off-by: Samuel Holland <samuel@...lland.org>
---
drivers/devfreq/devfreq.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 426e31e6c448..f5d27f5285db 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -130,16 +130,10 @@ static void get_freq_range(struct devfreq *devfreq,
/*
* Initialize minimum/maximum frequency from freq table.
- * The devfreq drivers can initialize this in either ascending or
- * descending order and devfreq core supports both.
+ * The devfreq drivers should initialize this in ascending order.
*/
- if (freq_table[0] < freq_table[devfreq->profile->max_state - 1]) {
- *min_freq = freq_table[0];
- *max_freq = freq_table[devfreq->profile->max_state - 1];
- } else {
- *min_freq = freq_table[devfreq->profile->max_state - 1];
- *max_freq = freq_table[0];
- }
+ *min_freq = freq_table[0];
+ *max_freq = freq_table[devfreq->profile->max_state - 1];
/* Apply constraints from PM QoS */
qos_min_freq = dev_pm_qos_read_value(devfreq->dev.parent,
--
2.31.1
Powered by blists - more mailing lists