hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/cpufreq/maple-cpufreq.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2011 Dmitry Eremin-Solenikov
34 * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org>
45 * and Markus Demleitner <msdemlei@cl.uni-heidelberg.de>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
96 *
107 * This driver adds basic cpufreq support for SMU & 970FX based G5 Macs,
118 * that is iMac G5 and latest single CPU desktop.
....@@ -143,7 +140,8 @@
143140
144141 static int maple_cpufreq_cpu_init(struct cpufreq_policy *policy)
145142 {
146
- return cpufreq_generic_init(policy, maple_cpu_freqs, 12000);
143
+ cpufreq_generic_init(policy, maple_cpu_freqs, 12000);
144
+ return 0;
147145 }
148146
149147 static struct cpufreq_driver maple_cpufreq_driver = {
....@@ -210,7 +208,7 @@
210208 */
211209 valp = of_get_property(cpunode, "clock-frequency", NULL);
212210 if (!valp)
213
- return -ENODEV;
211
+ goto bail_noprops;
214212 max_freq = (*valp)/1000;
215213 maple_cpu_freqs[0].frequency = max_freq;
216214 maple_cpu_freqs[1].frequency = max_freq/2;
....@@ -230,10 +228,6 @@
230228 maple_cpu_freqs[maple_pmode_cur].frequency/1000);
231229
232230 rc = cpufreq_register_driver(&maple_cpufreq_driver);
233
-
234
- of_node_put(cpunode);
235
-
236
- return rc;
237231
238232 bail_noprops:
239233 of_node_put(cpunode);