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 | |
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')
-rw-r--r-- | drivers/base/power/opp.c | 41 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq-cpu0.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/exynos5440-cpufreq.c | 2 | ||||
-rw-r--r-- | drivers/cpufreq/imx6q-cpufreq.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/omap-cpufreq.c | 2 | ||||
-rw-r--r-- | drivers/devfreq/devfreq.c | 9 | ||||
-rw-r--r-- | drivers/devfreq/exynos/exynos4_bus.c | 6 | ||||
-rw-r--r-- | drivers/devfreq/exynos/exynos5_bus.c | 6 |
8 files changed, 39 insertions, 35 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 | ||
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index af951a9cea78..d73107894fee 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c | |||
@@ -44,7 +44,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy, | |||
44 | unsigned int target_freq, unsigned int relation) | 44 | unsigned int target_freq, unsigned int relation) |
45 | { | 45 | { |
46 | struct cpufreq_freqs freqs; | 46 | struct cpufreq_freqs freqs; |
47 | struct opp *opp; | 47 | struct dev_pm_opp *opp; |
48 | unsigned long volt = 0, volt_old = 0, tol = 0; | 48 | unsigned long volt = 0, volt_old = 0, tol = 0; |
49 | long freq_Hz, freq_exact; | 49 | long freq_Hz, freq_exact; |
50 | unsigned int index; | 50 | unsigned int index; |
@@ -230,7 +230,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) | |||
230 | transition_latency = CPUFREQ_ETERNAL; | 230 | transition_latency = CPUFREQ_ETERNAL; |
231 | 231 | ||
232 | if (!IS_ERR(cpu_reg)) { | 232 | if (!IS_ERR(cpu_reg)) { |
233 | struct opp *opp; | 233 | struct dev_pm_opp *opp; |
234 | unsigned long min_uV, max_uV; | 234 | unsigned long min_uV, max_uV; |
235 | int i; | 235 | int i; |
236 | 236 | ||
diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c index 444eca74d3c2..c8b3d3950f9e 100644 --- a/drivers/cpufreq/exynos5440-cpufreq.c +++ b/drivers/cpufreq/exynos5440-cpufreq.c | |||
@@ -118,7 +118,7 @@ static int init_div_table(void) | |||
118 | struct cpufreq_frequency_table *freq_tbl = dvfs_info->freq_table; | 118 | struct cpufreq_frequency_table *freq_tbl = dvfs_info->freq_table; |
119 | unsigned int tmp, clk_div, ema_div, freq, volt_id; | 119 | unsigned int tmp, clk_div, ema_div, freq, volt_id; |
120 | int i = 0; | 120 | int i = 0; |
121 | struct opp *opp; | 121 | struct dev_pm_opp *opp; |
122 | 122 | ||
123 | rcu_read_lock(); | 123 | rcu_read_lock(); |
124 | for (i = 0; freq_tbl[i].frequency != CPUFREQ_TABLE_END; i++) { | 124 | for (i = 0; freq_tbl[i].frequency != CPUFREQ_TABLE_END; i++) { |
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index b360549e7715..84e993dfb305 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c | |||
@@ -49,7 +49,7 @@ static int imx6q_set_target(struct cpufreq_policy *policy, | |||
49 | unsigned int target_freq, unsigned int relation) | 49 | unsigned int target_freq, unsigned int relation) |
50 | { | 50 | { |
51 | struct cpufreq_freqs freqs; | 51 | struct cpufreq_freqs freqs; |
52 | struct opp *opp; | 52 | struct dev_pm_opp *opp; |
53 | unsigned long freq_hz, volt, volt_old; | 53 | unsigned long freq_hz, volt, volt_old; |
54 | unsigned int index; | 54 | unsigned int index; |
55 | int ret; | 55 | int ret; |
@@ -199,7 +199,7 @@ static struct cpufreq_driver imx6q_cpufreq_driver = { | |||
199 | static int imx6q_cpufreq_probe(struct platform_device *pdev) | 199 | static int imx6q_cpufreq_probe(struct platform_device *pdev) |
200 | { | 200 | { |
201 | struct device_node *np; | 201 | struct device_node *np; |
202 | struct opp *opp; | 202 | struct dev_pm_opp *opp; |
203 | unsigned long min_volt, max_volt; | 203 | unsigned long min_volt, max_volt; |
204 | int num, ret; | 204 | int num, ret; |
205 | 205 | ||
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c index c5e31d296607..f057d423020c 100644 --- a/drivers/cpufreq/omap-cpufreq.c +++ b/drivers/cpufreq/omap-cpufreq.c | |||
@@ -65,7 +65,7 @@ static int omap_target(struct cpufreq_policy *policy, | |||
65 | unsigned int i; | 65 | unsigned int i; |
66 | int r, ret = 0; | 66 | int r, ret = 0; |
67 | struct cpufreq_freqs freqs; | 67 | struct cpufreq_freqs freqs; |
68 | struct opp *opp; | 68 | struct dev_pm_opp *opp; |
69 | unsigned long freq, volt = 0, volt_old = 0, tol = 0; | 69 | unsigned long freq, volt = 0, volt_old = 0, tol = 0; |
70 | 70 | ||
71 | if (!freq_table) { | 71 | if (!freq_table) { |
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index f798edcb910d..03530a0a8042 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c | |||
@@ -902,7 +902,7 @@ static ssize_t available_frequencies_show(struct device *d, | |||
902 | { | 902 | { |
903 | struct devfreq *df = to_devfreq(d); | 903 | struct devfreq *df = to_devfreq(d); |
904 | struct device *dev = df->dev.parent; | 904 | struct device *dev = df->dev.parent; |
905 | struct opp *opp; | 905 | struct dev_pm_opp *opp; |
906 | ssize_t count = 0; | 906 | ssize_t count = 0; |
907 | unsigned long freq = 0; | 907 | unsigned long freq = 0; |
908 | 908 | ||
@@ -1029,10 +1029,11 @@ module_exit(devfreq_exit); | |||
1029 | * under the locked area. The pointer returned must be used prior to unlocking | 1029 | * under the locked area. The pointer returned must be used prior to unlocking |
1030 | * with rcu_read_unlock() to maintain the integrity of the pointer. | 1030 | * with rcu_read_unlock() to maintain the integrity of the pointer. |
1031 | */ | 1031 | */ |
1032 | struct opp *devfreq_recommended_opp(struct device *dev, unsigned long *freq, | 1032 | struct dev_pm_opp *devfreq_recommended_opp(struct device *dev, |
1033 | u32 flags) | 1033 | unsigned long *freq, |
1034 | u32 flags) | ||
1034 | { | 1035 | { |
1035 | struct opp *opp; | 1036 | struct dev_pm_opp *opp; |
1036 | 1037 | ||
1037 | if (flags & DEVFREQ_FLAG_LEAST_UPPER_BOUND) { | 1038 | if (flags & DEVFREQ_FLAG_LEAST_UPPER_BOUND) { |
1038 | /* The freq is an upper bound. opp should be lower */ | 1039 | /* The freq is an upper bound. opp should be lower */ |
diff --git a/drivers/devfreq/exynos/exynos4_bus.c b/drivers/devfreq/exynos/exynos4_bus.c index 33c0e05a5ff1..891becd46513 100644 --- a/drivers/devfreq/exynos/exynos4_bus.c +++ b/drivers/devfreq/exynos/exynos4_bus.c | |||
@@ -639,7 +639,7 @@ static int exynos4_bus_target(struct device *dev, unsigned long *_freq, | |||
639 | struct platform_device *pdev = container_of(dev, struct platform_device, | 639 | struct platform_device *pdev = container_of(dev, struct platform_device, |
640 | dev); | 640 | dev); |
641 | struct busfreq_data *data = platform_get_drvdata(pdev); | 641 | struct busfreq_data *data = platform_get_drvdata(pdev); |
642 | struct opp *opp; | 642 | struct dev_pm_opp *opp; |
643 | unsigned long freq; | 643 | unsigned long freq; |
644 | unsigned long old_freq = data->curr_oppinfo.rate; | 644 | unsigned long old_freq = data->curr_oppinfo.rate; |
645 | struct busfreq_opp_info new_oppinfo; | 645 | struct busfreq_opp_info new_oppinfo; |
@@ -956,7 +956,7 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this, | |||
956 | { | 956 | { |
957 | struct busfreq_data *data = container_of(this, struct busfreq_data, | 957 | struct busfreq_data *data = container_of(this, struct busfreq_data, |
958 | pm_notifier); | 958 | pm_notifier); |
959 | struct opp *opp; | 959 | struct dev_pm_opp *opp; |
960 | struct busfreq_opp_info new_oppinfo; | 960 | struct busfreq_opp_info new_oppinfo; |
961 | unsigned long maxfreq = ULONG_MAX; | 961 | unsigned long maxfreq = ULONG_MAX; |
962 | int err = 0; | 962 | int err = 0; |
@@ -1020,7 +1020,7 @@ unlock: | |||
1020 | static int exynos4_busfreq_probe(struct platform_device *pdev) | 1020 | static int exynos4_busfreq_probe(struct platform_device *pdev) |
1021 | { | 1021 | { |
1022 | struct busfreq_data *data; | 1022 | struct busfreq_data *data; |
1023 | struct opp *opp; | 1023 | struct dev_pm_opp *opp; |
1024 | struct device *dev = &pdev->dev; | 1024 | struct device *dev = &pdev->dev; |
1025 | int err = 0; | 1025 | int err = 0; |
1026 | 1026 | ||
diff --git a/drivers/devfreq/exynos/exynos5_bus.c b/drivers/devfreq/exynos/exynos5_bus.c index b0e45925505b..d06232aa0738 100644 --- a/drivers/devfreq/exynos/exynos5_bus.c +++ b/drivers/devfreq/exynos/exynos5_bus.c | |||
@@ -132,7 +132,7 @@ static int exynos5_busfreq_int_target(struct device *dev, unsigned long *_freq, | |||
132 | struct platform_device *pdev = container_of(dev, struct platform_device, | 132 | struct platform_device *pdev = container_of(dev, struct platform_device, |
133 | dev); | 133 | dev); |
134 | struct busfreq_data_int *data = platform_get_drvdata(pdev); | 134 | struct busfreq_data_int *data = platform_get_drvdata(pdev); |
135 | struct opp *opp; | 135 | struct dev_pm_opp *opp; |
136 | unsigned long old_freq, freq; | 136 | unsigned long old_freq, freq; |
137 | unsigned long volt; | 137 | unsigned long volt; |
138 | 138 | ||
@@ -262,7 +262,7 @@ static int exynos5_busfreq_int_pm_notifier_event(struct notifier_block *this, | |||
262 | { | 262 | { |
263 | struct busfreq_data_int *data = container_of(this, | 263 | struct busfreq_data_int *data = container_of(this, |
264 | struct busfreq_data_int, pm_notifier); | 264 | struct busfreq_data_int, pm_notifier); |
265 | struct opp *opp; | 265 | struct dev_pm_opp *opp; |
266 | unsigned long maxfreq = ULONG_MAX; | 266 | unsigned long maxfreq = ULONG_MAX; |
267 | unsigned long freq; | 267 | unsigned long freq; |
268 | unsigned long volt; | 268 | unsigned long volt; |
@@ -316,7 +316,7 @@ unlock: | |||
316 | static int exynos5_busfreq_int_probe(struct platform_device *pdev) | 316 | static int exynos5_busfreq_int_probe(struct platform_device *pdev) |
317 | { | 317 | { |
318 | struct busfreq_data_int *data; | 318 | struct busfreq_data_int *data; |
319 | struct opp *opp; | 319 | struct dev_pm_opp *opp; |
320 | struct device *dev = &pdev->dev; | 320 | struct device *dev = &pdev->dev; |
321 | struct device_node *np; | 321 | struct device_node *np; |
322 | unsigned long initial_freq; | 322 | unsigned long initial_freq; |