armbian-build/patch/kernel/archive/sunxi-5.15/megous/PM-devfreq-Drop-code-for-descending-freq_table.patch
The-going 33c413c679
Patches megous 5.15.5 (#3295)
* Rework patches for sunxi 5.15.4

* Rework patches sunxi for 5.15.5

* Kernel switch tag=v5.15.5 for sunxi EDGE

* Temporarily disabled, requires rework.

drivers/clk/sunxi-ng/sun8i-de33.c: In function ‘sunxi_de33_clk_probe’:
drivers/clk/sunxi-ng/sun8i-de33.c:155:8:
 error: implicit declaration of function ‘sunxi_ccu_probe’;
 did you mean ‘of_sunxi_ccu_probe’? [-Werror=implicit-function-declarati>
  ret = sunxi_ccu_probe(pdev->dev.of_node, reg, ccu_desc);
        ^~~~~~~~~~~~~~~
        of_sunxi_ccu_probe
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:277:
         drivers/clk/sunxi-ng/sun8i-de33.o] Error 1
make[2]: *** [scripts/Makefile.build:540: drivers/clk/sunxi-ng] Error 2

* Correct the comment.
2021-11-28 16:48:47 +01:00

47 lines
1.7 KiB
Diff

From a284146a3753f205f0e78be40ead95d8253c587b Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 3 Apr 2021 17:05:37 -0500
Subject: [PATCH 409/467] 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@sholland.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 dea2fab64..9606eab1a 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.34.0