.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright 2009 Wolfson Microelectronics plc |
---|
3 | 4 | * |
---|
4 | 5 | * 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. |
---|
9 | 6 | */ |
---|
10 | 7 | |
---|
11 | 8 | #define pr_fmt(fmt) "cpufreq: " fmt |
---|
.. | .. |
---|
22 | 19 | static struct regulator *vddarm; |
---|
23 | 20 | static unsigned long regulator_latency; |
---|
24 | 21 | |
---|
25 | | -#ifdef CONFIG_CPU_S3C6410 |
---|
26 | 22 | struct s3c64xx_dvfs { |
---|
27 | 23 | unsigned int vddarm_min; |
---|
28 | 24 | unsigned int vddarm_max; |
---|
.. | .. |
---|
51 | 47 | { 0, 4, 800000 }, |
---|
52 | 48 | { 0, 0, CPUFREQ_TABLE_END }, |
---|
53 | 49 | }; |
---|
54 | | -#endif |
---|
55 | 50 | |
---|
56 | 51 | static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy, |
---|
57 | 52 | unsigned int index) |
---|
.. | .. |
---|
147 | 142 | |
---|
148 | 143 | static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy) |
---|
149 | 144 | { |
---|
150 | | - int ret; |
---|
151 | 145 | struct cpufreq_frequency_table *freq; |
---|
152 | 146 | |
---|
153 | 147 | if (policy->cpu != 0) |
---|
154 | 148 | return -EINVAL; |
---|
155 | | - |
---|
156 | | - if (s3c64xx_freq_table == NULL) { |
---|
157 | | - pr_err("No frequency information for this CPU\n"); |
---|
158 | | - return -ENODEV; |
---|
159 | | - } |
---|
160 | 149 | |
---|
161 | 150 | policy->clk = clk_get(NULL, "armclk"); |
---|
162 | 151 | if (IS_ERR(policy->clk)) { |
---|
.. | .. |
---|
168 | 157 | #ifdef CONFIG_REGULATOR |
---|
169 | 158 | vddarm = regulator_get(NULL, "vddarm"); |
---|
170 | 159 | 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)); |
---|
173 | 161 | pr_err("Only frequency scaling available\n"); |
---|
174 | 162 | vddarm = NULL; |
---|
175 | 163 | } else { |
---|
.. | .. |
---|
199 | 187 | * the PLLs, which we don't currently) is ~300us worst case, |
---|
200 | 188 | * but add some fudge. |
---|
201 | 189 | */ |
---|
202 | | - ret = cpufreq_generic_init(policy, s3c64xx_freq_table, |
---|
| 190 | + cpufreq_generic_init(policy, s3c64xx_freq_table, |
---|
203 | 191 | (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; |
---|
212 | 193 | } |
---|
213 | 194 | |
---|
214 | 195 | static struct cpufreq_driver s3c64xx_cpufreq_driver = { |
---|