diff options
author | Nishanth Menon <nm@ti.com> | 2013-09-19 17:03:51 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@rjwysocki.net> | 2013-10-25 16:33:23 -0400 |
commit | 47d43ba73eb98d8ba731208735c899129d9849e1 (patch) | |
tree | 77a8efb02e01ab183b08bf7b88fd50d3991c0873 /drivers/base | |
parent | 5d4879cda67b09f086807821cf594ee079d6dfbe (diff) |
PM / OPP: rename data structures to dev_pm equivalents
Since Operating Performance Points (OPP) data structures are specific
to device specific power management, be specific and rename opp_* data
structures in OPP library with dev_pm_opp_* equivalent.
Affected structures are:
struct opp
enum opp_event
Minor checkpatch warning resulting of this change was fixed as well.
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/opp.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index 00c6a449cdeb..693e14a24914 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c | |||
@@ -42,7 +42,7 @@ | |||
42 | */ | 42 | */ |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * struct opp - Generic OPP description structure | 45 | * struct dev_pm_opp - Generic OPP description structure |
46 | * @node: opp list node. The nodes are maintained throughout the lifetime | 46 | * @node: opp list node. The nodes are maintained throughout the lifetime |
47 | * of boot. It is expected only an optimal set of OPPs are | 47 | * of boot. It is expected only an optimal set of OPPs are |
48 | * added to the library by the SoC framework. | 48 | * added to the library by the SoC framework. |
@@ -59,7 +59,7 @@ | |||
59 | * | 59 | * |
60 | * This structure stores the OPP information for a given device. | 60 | * This structure stores the OPP information for a given device. |
61 | */ | 61 | */ |
62 | struct opp { | 62 | struct dev_pm_opp { |
63 | struct list_head node; | 63 | struct list_head node; |
64 | 64 | ||
65 | bool available; | 65 | bool available; |
@@ -150,9 +150,9 @@ static struct device_opp *find_device_opp(struct device *dev) | |||
150 | * prior to unlocking with rcu_read_unlock() to maintain the integrity of the | 150 | * prior to unlocking with rcu_read_unlock() to maintain the integrity of the |
151 | * pointer. | 151 | * pointer. |
152 | */ | 152 | */ |
153 | unsigned long dev_pm_opp_get_voltage(struct opp *opp) | 153 | unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp) |
154 | { | 154 | { |
155 | struct opp *tmp_opp; | 155 | struct dev_pm_opp *tmp_opp; |
156 | unsigned long v = 0; | 156 | unsigned long v = 0; |
157 | 157 | ||
158 | tmp_opp = rcu_dereference(opp); | 158 | tmp_opp = rcu_dereference(opp); |
@@ -180,9 +180,9 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_get_voltage); | |||
180 | * prior to unlocking with rcu_read_unlock() to maintain the integrity of the | 180 | * prior to unlocking with rcu_read_unlock() to maintain the integrity of the |
181 | * pointer. | 181 | * pointer. |
182 | */ | 182 | */ |
183 | unsigned long dev_pm_opp_get_freq(struct opp *opp) | 183 | unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp) |
184 | { | 184 | { |
185 | struct opp *tmp_opp; | 185 | struct dev_pm_opp *tmp_opp; |
186 | unsigned long f = 0; | 186 | unsigned long f = 0; |
187 | 187 | ||
188 | tmp_opp = rcu_dereference(opp); | 188 | tmp_opp = rcu_dereference(opp); |
@@ -209,7 +209,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_get_freq); | |||
209 | int dev_pm_opp_get_opp_count(struct device *dev) | 209 | int dev_pm_opp_get_opp_count(struct device *dev) |
210 | { | 210 | { |
211 | struct device_opp *dev_opp; | 211 | struct device_opp *dev_opp; |
212 | struct opp *temp_opp; | 212 | struct dev_pm_opp *temp_opp; |
213 | int count = 0; | 213 | int count = 0; |
214 | 214 | ||
215 | dev_opp = find_device_opp(dev); | 215 | dev_opp = find_device_opp(dev); |
@@ -254,11 +254,12 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_get_opp_count); | |||
254 | * under the locked area. The pointer returned must be used prior to unlocking | 254 | * under the locked area. The pointer returned must be used prior to unlocking |
255 | * with rcu_read_unlock() to maintain the integrity of the pointer. | 255 | * with rcu_read_unlock() to maintain the integrity of the pointer. |
256 | */ | 256 | */ |
257 | struct opp *dev_pm_opp_find_freq_exact(struct device *dev, unsigned long freq, | 257 | struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, |
258 | bool available) | 258 | unsigned long freq, |
259 | bool available) | ||
259 | { | 260 | { |
260 | struct device_opp *dev_opp; | 261 | struct device_opp *dev_opp; |
261 | struct opp *temp_opp, *opp = ERR_PTR(-ERANGE); | 262 | struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ERANGE); |
262 | 263 | ||
263 | dev_opp = find_device_opp(dev); | 264 | dev_opp = find_device_opp(dev); |
264 | if (IS_ERR(dev_opp)) { | 265 | if (IS_ERR(dev_opp)) { |
@@ -300,10 +301,11 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_exact); | |||
300 | * under the locked area. The pointer returned must be used prior to unlocking | 301 | * under the locked area. The pointer returned must be used prior to unlocking |
301 | * with rcu_read_unlock() to maintain the integrity of the pointer. | 302 | * with rcu_read_unlock() to maintain the integrity of the pointer. |
302 | */ | 303 | */ |
303 | struct opp *dev_pm_opp_find_freq_ceil(struct device *dev, unsigned long *freq) | 304 | struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, |
305 | unsigned long *freq) | ||
304 | { | 306 | { |
305 | struct device_opp *dev_opp; | 307 | struct device_opp *dev_opp; |
306 | struct opp *temp_opp, *opp = ERR_PTR(-ERANGE); | 308 | struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ERANGE); |
307 | 309 | ||
308 | if (!dev || !freq) { | 310 | if (!dev || !freq) { |
309 | dev_err(dev, "%s: Invalid argument freq=%p\n", __func__, freq); | 311 | dev_err(dev, "%s: Invalid argument freq=%p\n", __func__, freq); |
@@ -347,10 +349,11 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_ceil); | |||
347 | * under the locked area. The pointer returned must be used prior to unlocking | 349 | * under the locked area. The pointer returned must be used prior to unlocking |
348 | * with rcu_read_unlock() to maintain the integrity of the pointer. | 350 | * with rcu_read_unlock() to maintain the integrity of the pointer. |
349 | */ | 351 | */ |
350 | struct opp *dev_pm_opp_find_freq_floor(struct device *dev, unsigned long *freq) | 352 | struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, |
353 | unsigned long *freq) | ||
351 | { | 354 | { |
352 | struct device_opp *dev_opp; | 355 | struct device_opp *dev_opp; |
353 | struct opp *temp_opp, *opp = ERR_PTR(-ERANGE); | 356 | struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ERANGE); |
354 | 357 | ||
355 | if (!dev || !freq) { | 358 | if (!dev || !freq) { |
356 | dev_err(dev, "%s: Invalid argument freq=%p\n", __func__, freq); | 359 | dev_err(dev, "%s: Invalid argument freq=%p\n", __func__, freq); |
@@ -396,11 +399,11 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_floor); | |||
396 | int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt) | 399 | int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt) |
397 | { | 400 | { |
398 | struct device_opp *dev_opp = NULL; | 401 | struct device_opp *dev_opp = NULL; |
399 | struct opp *opp, *new_opp; | 402 | struct dev_pm_opp *opp, *new_opp; |
400 | struct list_head *head; | 403 | struct list_head *head; |
401 | 404 | ||
402 | /* allocate new OPP node */ | 405 | /* allocate new OPP node */ |
403 | new_opp = kzalloc(sizeof(struct opp), GFP_KERNEL); | 406 | new_opp = kzalloc(sizeof(*new_opp), GFP_KERNEL); |
404 | if (!new_opp) { | 407 | if (!new_opp) { |
405 | dev_warn(dev, "%s: Unable to create new OPP node\n", __func__); | 408 | dev_warn(dev, "%s: Unable to create new OPP node\n", __func__); |
406 | return -ENOMEM; | 409 | return -ENOMEM; |
@@ -485,11 +488,11 @@ static int opp_set_availability(struct device *dev, unsigned long freq, | |||
485 | bool availability_req) | 488 | bool availability_req) |
486 | { | 489 | { |
487 | struct device_opp *tmp_dev_opp, *dev_opp = ERR_PTR(-ENODEV); | 490 | struct device_opp *tmp_dev_opp, *dev_opp = ERR_PTR(-ENODEV); |
488 | struct opp *new_opp, *tmp_opp, *opp = ERR_PTR(-ENODEV); | 491 | struct dev_pm_opp *new_opp, *tmp_opp, *opp = ERR_PTR(-ENODEV); |
489 | int r = 0; | 492 | int r = 0; |
490 | 493 | ||
491 | /* keep the node allocated */ | 494 | /* keep the node allocated */ |
492 | new_opp = kmalloc(sizeof(struct opp), GFP_KERNEL); | 495 | new_opp = kmalloc(sizeof(*new_opp), GFP_KERNEL); |
493 | if (!new_opp) { | 496 | if (!new_opp) { |
494 | dev_warn(dev, "%s: Unable to create OPP\n", __func__); | 497 | dev_warn(dev, "%s: Unable to create OPP\n", __func__); |
495 | return -ENOMEM; | 498 | return -ENOMEM; |
@@ -623,7 +626,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev, | |||
623 | struct cpufreq_frequency_table **table) | 626 | struct cpufreq_frequency_table **table) |
624 | { | 627 | { |
625 | struct device_opp *dev_opp; | 628 | struct device_opp *dev_opp; |
626 | struct opp *opp; | 629 | struct dev_pm_opp *opp; |
627 | struct cpufreq_frequency_table *freq_table; | 630 | struct cpufreq_frequency_table *freq_table; |
628 | int i = 0; | 631 | int i = 0; |
629 | 632 | ||