diff options
author | Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> | 2015-01-02 19:37:43 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2015-01-07 12:53:51 -0500 |
commit | b91dc63b2d59a03618abdf19d9172dcce5c4921e (patch) | |
tree | abd6263264b62d965c2b153e501d956a08cb5611 /arch/arm/mach-omap2 | |
parent | 10637afb9157c5da28aef0465cd9e6135af5148b (diff) |
ARM: OMAP2+: voltage: Remove some unused functions
Removes some functions that are not used anywhere:
omap_change_voltscale_method() voltdm_add_pwrdm()
voltdm_for_each() voltdm_for_each_pwrdm()
And remove define VOLTSCALE_VPFORCEUPDATE and VOLTSCALE_VCBYPASS
This was partially found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/powerdomain.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/voltage.c | 110 | ||||
-rw-r--r-- | arch/arm/mach-omap2/voltage.h | 13 |
3 files changed, 0 insertions, 124 deletions
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 6bd6025716ea..78af6d8cf2e2 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -115,7 +115,6 @@ static int _pwrdm_register(struct powerdomain *pwrdm) | |||
115 | } | 115 | } |
116 | pwrdm->voltdm.ptr = voltdm; | 116 | pwrdm->voltdm.ptr = voltdm; |
117 | INIT_LIST_HEAD(&pwrdm->voltdm_node); | 117 | INIT_LIST_HEAD(&pwrdm->voltdm_node); |
118 | voltdm_add_pwrdm(voltdm, pwrdm); | ||
119 | skip_voltdm: | 118 | skip_voltdm: |
120 | spin_lock_init(&pwrdm->_lock); | 119 | spin_lock_init(&pwrdm->_lock); |
121 | 120 | ||
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c index 3783b8625f0f..cba8cada8c81 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c | |||
@@ -224,37 +224,6 @@ int omap_voltage_register_pmic(struct voltagedomain *voltdm, | |||
224 | } | 224 | } |
225 | 225 | ||
226 | /** | 226 | /** |
227 | * omap_change_voltscale_method() - API to change the voltage scaling method. | ||
228 | * @voltdm: pointer to the VDD whose voltage scaling method | ||
229 | * has to be changed. | ||
230 | * @voltscale_method: the method to be used for voltage scaling. | ||
231 | * | ||
232 | * This API can be used by the board files to change the method of voltage | ||
233 | * scaling between vpforceupdate and vcbypass. The parameter values are | ||
234 | * defined in voltage.h | ||
235 | */ | ||
236 | void omap_change_voltscale_method(struct voltagedomain *voltdm, | ||
237 | int voltscale_method) | ||
238 | { | ||
239 | if (!voltdm || IS_ERR(voltdm)) { | ||
240 | pr_warn("%s: VDD specified does not exist!\n", __func__); | ||
241 | return; | ||
242 | } | ||
243 | |||
244 | switch (voltscale_method) { | ||
245 | case VOLTSCALE_VPFORCEUPDATE: | ||
246 | voltdm->scale = omap_vp_forceupdate_scale; | ||
247 | return; | ||
248 | case VOLTSCALE_VCBYPASS: | ||
249 | voltdm->scale = omap_vc_bypass_scale; | ||
250 | return; | ||
251 | default: | ||
252 | pr_warn("%s: Trying to change the method of voltage scaling to an unsupported one!\n", | ||
253 | __func__); | ||
254 | } | ||
255 | } | ||
256 | |||
257 | /** | ||
258 | * omap_voltage_late_init() - Init the various voltage parameters | 227 | * omap_voltage_late_init() - Init the various voltage parameters |
259 | * | 228 | * |
260 | * This API is to be called in the later stages of the | 229 | * This API is to be called in the later stages of the |
@@ -316,90 +285,11 @@ static struct voltagedomain *_voltdm_lookup(const char *name) | |||
316 | return voltdm; | 285 | return voltdm; |
317 | } | 286 | } |
318 | 287 | ||
319 | /** | ||
320 | * voltdm_add_pwrdm - add a powerdomain to a voltagedomain | ||
321 | * @voltdm: struct voltagedomain * to add the powerdomain to | ||
322 | * @pwrdm: struct powerdomain * to associate with a voltagedomain | ||
323 | * | ||
324 | * Associate the powerdomain @pwrdm with a voltagedomain @voltdm. This | ||
325 | * enables the use of voltdm_for_each_pwrdm(). Returns -EINVAL if | ||
326 | * presented with invalid pointers; -ENOMEM if memory could not be allocated; | ||
327 | * or 0 upon success. | ||
328 | */ | ||
329 | int voltdm_add_pwrdm(struct voltagedomain *voltdm, struct powerdomain *pwrdm) | ||
330 | { | ||
331 | if (!voltdm || !pwrdm) | ||
332 | return -EINVAL; | ||
333 | |||
334 | pr_debug("voltagedomain: %s: associating powerdomain %s\n", | ||
335 | voltdm->name, pwrdm->name); | ||
336 | |||
337 | list_add(&pwrdm->voltdm_node, &voltdm->pwrdm_list); | ||
338 | |||
339 | return 0; | ||
340 | } | ||
341 | |||
342 | /** | ||
343 | * voltdm_for_each_pwrdm - call function for each pwrdm in a voltdm | ||
344 | * @voltdm: struct voltagedomain * to iterate over | ||
345 | * @fn: callback function * | ||
346 | * | ||
347 | * Call the supplied function @fn for each powerdomain in the | ||
348 | * voltagedomain @voltdm. Returns -EINVAL if presented with invalid | ||
349 | * pointers; or passes along the last return value of the callback | ||
350 | * function, which should be 0 for success or anything else to | ||
351 | * indicate failure. | ||
352 | */ | ||
353 | int voltdm_for_each_pwrdm(struct voltagedomain *voltdm, | ||
354 | int (*fn)(struct voltagedomain *voltdm, | ||
355 | struct powerdomain *pwrdm)) | ||
356 | { | ||
357 | struct powerdomain *pwrdm; | ||
358 | int ret = 0; | ||
359 | |||
360 | if (!fn) | ||
361 | return -EINVAL; | ||
362 | |||
363 | list_for_each_entry(pwrdm, &voltdm->pwrdm_list, voltdm_node) | ||
364 | ret = (*fn)(voltdm, pwrdm); | ||
365 | |||
366 | return ret; | ||
367 | } | ||
368 | |||
369 | /** | ||
370 | * voltdm_for_each - call function on each registered voltagedomain | ||
371 | * @fn: callback function * | ||
372 | * | ||
373 | * Call the supplied function @fn for each registered voltagedomain. | ||
374 | * The callback function @fn can return anything but 0 to bail out | ||
375 | * early from the iterator. Returns the last return value of the | ||
376 | * callback function, which should be 0 for success or anything else | ||
377 | * to indicate failure; or -EINVAL if the function pointer is null. | ||
378 | */ | ||
379 | int voltdm_for_each(int (*fn)(struct voltagedomain *voltdm, void *user), | ||
380 | void *user) | ||
381 | { | ||
382 | struct voltagedomain *temp_voltdm; | ||
383 | int ret = 0; | ||
384 | |||
385 | if (!fn) | ||
386 | return -EINVAL; | ||
387 | |||
388 | list_for_each_entry(temp_voltdm, &voltdm_list, node) { | ||
389 | ret = (*fn)(temp_voltdm, user); | ||
390 | if (ret) | ||
391 | break; | ||
392 | } | ||
393 | |||
394 | return ret; | ||
395 | } | ||
396 | |||
397 | static int _voltdm_register(struct voltagedomain *voltdm) | 288 | static int _voltdm_register(struct voltagedomain *voltdm) |
398 | { | 289 | { |
399 | if (!voltdm || !voltdm->name) | 290 | if (!voltdm || !voltdm->name) |
400 | return -EINVAL; | 291 | return -EINVAL; |
401 | 292 | ||
402 | INIT_LIST_HEAD(&voltdm->pwrdm_list); | ||
403 | list_add(&voltdm->node, &voltdm_list); | 293 | list_add(&voltdm->node, &voltdm_list); |
404 | 294 | ||
405 | pr_debug("voltagedomain: registered %s\n", voltdm->name); | 295 | pr_debug("voltagedomain: registered %s\n", voltdm->name); |
diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h index f7f2879b31b0..e64550321510 100644 --- a/arch/arm/mach-omap2/voltage.h +++ b/arch/arm/mach-omap2/voltage.h | |||
@@ -23,10 +23,6 @@ | |||
23 | 23 | ||
24 | struct powerdomain; | 24 | struct powerdomain; |
25 | 25 | ||
26 | /* XXX document */ | ||
27 | #define VOLTSCALE_VPFORCEUPDATE 1 | ||
28 | #define VOLTSCALE_VCBYPASS 2 | ||
29 | |||
30 | /* | 26 | /* |
31 | * OMAP3 GENERIC setup times. Revisit to see if these needs to be | 27 | * OMAP3 GENERIC setup times. Revisit to see if these needs to be |
32 | * passed from board or PMIC file | 28 | * passed from board or PMIC file |
@@ -55,7 +51,6 @@ struct omap_vfsm_instance { | |||
55 | * @name: Name of the voltage domain which can be used as a unique identifier. | 51 | * @name: Name of the voltage domain which can be used as a unique identifier. |
56 | * @scalable: Whether or not this voltage domain is scalable | 52 | * @scalable: Whether or not this voltage domain is scalable |
57 | * @node: list_head linking all voltage domains | 53 | * @node: list_head linking all voltage domains |
58 | * @pwrdm_list: list_head linking all powerdomains in this voltagedomain | ||
59 | * @vc: pointer to VC channel associated with this voltagedomain | 54 | * @vc: pointer to VC channel associated with this voltagedomain |
60 | * @vp: pointer to VP associated with this voltagedomain | 55 | * @vp: pointer to VP associated with this voltagedomain |
61 | * @read: read a VC/VP register | 56 | * @read: read a VC/VP register |
@@ -71,7 +66,6 @@ struct voltagedomain { | |||
71 | char *name; | 66 | char *name; |
72 | bool scalable; | 67 | bool scalable; |
73 | struct list_head node; | 68 | struct list_head node; |
74 | struct list_head pwrdm_list; | ||
75 | struct omap_vc_channel *vc; | 69 | struct omap_vc_channel *vc; |
76 | const struct omap_vfsm_instance *vfsm; | 70 | const struct omap_vfsm_instance *vfsm; |
77 | struct omap_vp_instance *vp; | 71 | struct omap_vp_instance *vp; |
@@ -163,8 +157,6 @@ struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, | |||
163 | unsigned long volt); | 157 | unsigned long volt); |
164 | int omap_voltage_register_pmic(struct voltagedomain *voltdm, | 158 | int omap_voltage_register_pmic(struct voltagedomain *voltdm, |
165 | struct omap_voltdm_pmic *pmic); | 159 | struct omap_voltdm_pmic *pmic); |
166 | void omap_change_voltscale_method(struct voltagedomain *voltdm, | ||
167 | int voltscale_method); | ||
168 | int omap_voltage_late_init(void); | 160 | int omap_voltage_late_init(void); |
169 | 161 | ||
170 | extern void omap2xxx_voltagedomains_init(void); | 162 | extern void omap2xxx_voltagedomains_init(void); |
@@ -175,11 +167,6 @@ extern void omap54xx_voltagedomains_init(void); | |||
175 | struct voltagedomain *voltdm_lookup(const char *name); | 167 | struct voltagedomain *voltdm_lookup(const char *name); |
176 | void voltdm_init(struct voltagedomain **voltdm_list); | 168 | void voltdm_init(struct voltagedomain **voltdm_list); |
177 | int voltdm_add_pwrdm(struct voltagedomain *voltdm, struct powerdomain *pwrdm); | 169 | int voltdm_add_pwrdm(struct voltagedomain *voltdm, struct powerdomain *pwrdm); |
178 | int voltdm_for_each(int (*fn)(struct voltagedomain *voltdm, void *user), | ||
179 | void *user); | ||
180 | int voltdm_for_each_pwrdm(struct voltagedomain *voltdm, | ||
181 | int (*fn)(struct voltagedomain *voltdm, | ||
182 | struct powerdomain *pwrdm)); | ||
183 | int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); | 170 | int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); |
184 | void voltdm_reset(struct voltagedomain *voltdm); | 171 | void voltdm_reset(struct voltagedomain *voltdm); |
185 | unsigned long voltdm_get_voltage(struct voltagedomain *voltdm); | 172 | unsigned long voltdm_get_voltage(struct voltagedomain *voltdm); |