hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/cpufreq/pmac32-cpufreq.c
....@@ -1,16 +1,12 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org>
34 * Copyright (C) 2004 John Steele Scott <toojays@toojays.net>
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License version 2 as
7
- * published by the Free Software Foundation.
85 *
96 * TODO: Need a big cleanup here. Basically, we need to have different
107 * cpufreq_driver structures for the different type of HW instead of the
118 * current mess. We also need to better deal with the detection of the
129 * type of machine.
13
- *
1410 */
1511
1612 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -128,7 +124,7 @@
128124 mtspr(SPRN_HID2, hid2);
129125 }
130126 }
131
-#ifdef CONFIG_6xx
127
+#ifdef CONFIG_PPC_BOOK3S_32
132128 low_choose_750fx_pll(low_speed);
133129 #endif
134130 if (low_speed == 1) {
....@@ -166,7 +162,7 @@
166162 }
167163
168164 /* set frequency */
169
-#ifdef CONFIG_6xx
165
+#ifdef CONFIG_PPC_BOOK3S_32
170166 low_choose_7447a_dfs(low_speed);
171167 #endif
172168 udelay(100);
....@@ -376,7 +372,8 @@
376372
377373 static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
378374 {
379
- return cpufreq_generic_init(policy, pmac_cpu_freqs, transition_latency);
375
+ cpufreq_generic_init(policy, pmac_cpu_freqs, transition_latency);
376
+ return 0;
380377 }
381378
382379 static u32 read_gpio(struct device_node *np)
....@@ -474,6 +471,10 @@
474471 if (slew_done_gpio_np)
475472 slew_done_gpio = read_gpio(slew_done_gpio_np);
476473
474
+ of_node_put(volt_gpio_np);
475
+ of_node_put(freq_gpio_np);
476
+ of_node_put(slew_done_gpio_np);
477
+
477478 /* If we use the frequency GPIOs, calculate the min/max speeds based
478479 * on the bus frequencies
479480 */