hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/cpufreq/s3c64xx-cpufreq.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright 2009 Wolfson Microelectronics plc
34 *
45 * S3C64xx CPUfreq Support
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
118 #define pr_fmt(fmt) "cpufreq: " fmt
....@@ -22,7 +19,6 @@
2219 static struct regulator *vddarm;
2320 static unsigned long regulator_latency;
2421
25
-#ifdef CONFIG_CPU_S3C6410
2622 struct s3c64xx_dvfs {
2723 unsigned int vddarm_min;
2824 unsigned int vddarm_max;
....@@ -51,7 +47,6 @@
5147 { 0, 4, 800000 },
5248 { 0, 0, CPUFREQ_TABLE_END },
5349 };
54
-#endif
5550
5651 static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy,
5752 unsigned int index)
....@@ -147,16 +142,10 @@
147142
148143 static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
149144 {
150
- int ret;
151145 struct cpufreq_frequency_table *freq;
152146
153147 if (policy->cpu != 0)
154148 return -EINVAL;
155
-
156
- if (s3c64xx_freq_table == NULL) {
157
- pr_err("No frequency information for this CPU\n");
158
- return -ENODEV;
159
- }
160149
161150 policy->clk = clk_get(NULL, "armclk");
162151 if (IS_ERR(policy->clk)) {
....@@ -168,8 +157,7 @@
168157 #ifdef CONFIG_REGULATOR
169158 vddarm = regulator_get(NULL, "vddarm");
170159 if (IS_ERR(vddarm)) {
171
- ret = PTR_ERR(vddarm);
172
- pr_err("Failed to obtain VDDARM: %d\n", ret);
160
+ pr_err("Failed to obtain VDDARM: %ld\n", PTR_ERR(vddarm));
173161 pr_err("Only frequency scaling available\n");
174162 vddarm = NULL;
175163 } else {
....@@ -199,16 +187,9 @@
199187 * the PLLs, which we don't currently) is ~300us worst case,
200188 * but add some fudge.
201189 */
202
- ret = cpufreq_generic_init(policy, s3c64xx_freq_table,
190
+ cpufreq_generic_init(policy, s3c64xx_freq_table,
203191 (500 * 1000) + regulator_latency);
204
- if (ret != 0) {
205
- pr_err("Failed to configure frequency table: %d\n",
206
- ret);
207
- regulator_put(vddarm);
208
- clk_put(policy->clk);
209
- }
210
-
211
- return ret;
192
+ return 0;
212193 }
213194
214195 static struct cpufreq_driver s3c64xx_cpufreq_driver = {