aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2013-09-19 17:03:50 -0400
committerRafael J. Wysocki <rjw@rjwysocki.net>2013-10-25 16:33:23 -0400
commit5d4879cda67b09f086807821cf594ee079d6dfbe (patch)
tree58532256e9bff42902510175e7cb7c727a89280b /drivers
parent31d141e3a666269a3b6fcccddb0351caf7454240 (diff)
PM / OPP: rename functions to dev_pm_opp*
Since Operating Performance Points (OPP) functions are specific to device specific power management, be specific and rename opp_* accessors in OPP library with dev_pm_opp_* equivalent. Affected functions are: opp_get_voltage opp_get_freq opp_get_opp_count opp_find_freq_exact opp_find_freq_floor opp_find_freq_ceil opp_add opp_enable opp_disable opp_get_notifier opp_init_cpufreq_table opp_free_cpufreq_table Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Nishanth Menon <nm@ti.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/power/opp.c82
-rw-r--r--drivers/cpufreq/arm_big_little.c6
-rw-r--r--drivers/cpufreq/cpufreq-cpu0.c18
-rw-r--r--drivers/cpufreq/exynos5440-cpufreq.c13
-rw-r--r--drivers/cpufreq/imx6q-cpufreq.c20
-rw-r--r--drivers/cpufreq/omap-cpufreq.c8
-rw-r--r--drivers/devfreq/devfreq.c14
-rw-r--r--drivers/devfreq/exynos/exynos4_bus.c21
-rw-r--r--drivers/devfreq/exynos/exynos5_bus.c18
9 files changed, 101 insertions, 99 deletions
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index ef89897c6043..00c6a449cdeb 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -136,7 +136,7 @@ static struct device_opp *find_device_opp(struct device *dev)
136} 136}
137 137
138/** 138/**
139 * opp_get_voltage() - Gets the voltage corresponding to an available opp 139 * dev_pm_opp_get_voltage() - Gets the voltage corresponding to an available opp
140 * @opp: opp for which voltage has to be returned for 140 * @opp: opp for which voltage has to be returned for
141 * 141 *
142 * Return voltage in micro volt corresponding to the opp, else 142 * Return voltage in micro volt corresponding to the opp, else
@@ -150,7 +150,7 @@ 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 */
153unsigned long opp_get_voltage(struct opp *opp) 153unsigned long dev_pm_opp_get_voltage(struct opp *opp)
154{ 154{
155 struct opp *tmp_opp; 155 struct opp *tmp_opp;
156 unsigned long v = 0; 156 unsigned long v = 0;
@@ -163,10 +163,10 @@ unsigned long opp_get_voltage(struct opp *opp)
163 163
164 return v; 164 return v;
165} 165}
166EXPORT_SYMBOL_GPL(opp_get_voltage); 166EXPORT_SYMBOL_GPL(dev_pm_opp_get_voltage);
167 167
168/** 168/**
169 * opp_get_freq() - Gets the frequency corresponding to an available opp 169 * dev_pm_opp_get_freq() - Gets the frequency corresponding to an available opp
170 * @opp: opp for which frequency has to be returned for 170 * @opp: opp for which frequency has to be returned for
171 * 171 *
172 * Return frequency in hertz corresponding to the opp, else 172 * Return frequency in hertz corresponding to the opp, else
@@ -180,7 +180,7 @@ EXPORT_SYMBOL_GPL(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 */
183unsigned long opp_get_freq(struct opp *opp) 183unsigned long dev_pm_opp_get_freq(struct opp *opp)
184{ 184{
185 struct opp *tmp_opp; 185 struct opp *tmp_opp;
186 unsigned long f = 0; 186 unsigned long f = 0;
@@ -193,10 +193,10 @@ unsigned long opp_get_freq(struct opp *opp)
193 193
194 return f; 194 return f;
195} 195}
196EXPORT_SYMBOL_GPL(opp_get_freq); 196EXPORT_SYMBOL_GPL(dev_pm_opp_get_freq);
197 197
198/** 198/**
199 * opp_get_opp_count() - Get number of opps available in the opp list 199 * dev_pm_opp_get_opp_count() - Get number of opps available in the opp list
200 * @dev: device for which we do this operation 200 * @dev: device for which we do this operation
201 * 201 *
202 * This function returns the number of available opps if there are any, 202 * This function returns the number of available opps if there are any,
@@ -206,7 +206,7 @@ EXPORT_SYMBOL_GPL(opp_get_freq);
206 * internally references two RCU protected structures: device_opp and opp which 206 * internally references two RCU protected structures: device_opp and opp which
207 * are safe as long as we are under a common RCU locked section. 207 * are safe as long as we are under a common RCU locked section.
208 */ 208 */
209int opp_get_opp_count(struct device *dev) 209int 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 opp *temp_opp;
@@ -226,10 +226,10 @@ int opp_get_opp_count(struct device *dev)
226 226
227 return count; 227 return count;
228} 228}
229EXPORT_SYMBOL_GPL(opp_get_opp_count); 229EXPORT_SYMBOL_GPL(dev_pm_opp_get_opp_count);
230 230
231/** 231/**
232 * opp_find_freq_exact() - search for an exact frequency 232 * dev_pm_opp_find_freq_exact() - search for an exact frequency
233 * @dev: device for which we do this operation 233 * @dev: device for which we do this operation
234 * @freq: frequency to search for 234 * @freq: frequency to search for
235 * @available: true/false - match for available opp 235 * @available: true/false - match for available opp
@@ -254,7 +254,7 @@ EXPORT_SYMBOL_GPL(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 */
257struct opp *opp_find_freq_exact(struct device *dev, unsigned long freq, 257struct opp *dev_pm_opp_find_freq_exact(struct device *dev, unsigned long freq,
258 bool available) 258 bool available)
259{ 259{
260 struct device_opp *dev_opp; 260 struct device_opp *dev_opp;
@@ -277,10 +277,10 @@ struct opp *opp_find_freq_exact(struct device *dev, unsigned long freq,
277 277
278 return opp; 278 return opp;
279} 279}
280EXPORT_SYMBOL_GPL(opp_find_freq_exact); 280EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_exact);
281 281
282/** 282/**
283 * opp_find_freq_ceil() - Search for an rounded ceil freq 283 * dev_pm_opp_find_freq_ceil() - Search for an rounded ceil freq
284 * @dev: device for which we do this operation 284 * @dev: device for which we do this operation
285 * @freq: Start frequency 285 * @freq: Start frequency
286 * 286 *
@@ -300,7 +300,7 @@ EXPORT_SYMBOL_GPL(opp_find_freq_exact);
300 * under the locked area. The pointer returned must be used prior to unlocking 300 * 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. 301 * with rcu_read_unlock() to maintain the integrity of the pointer.
302 */ 302 */
303struct opp *opp_find_freq_ceil(struct device *dev, unsigned long *freq) 303struct opp *dev_pm_opp_find_freq_ceil(struct device *dev, unsigned long *freq)
304{ 304{
305 struct device_opp *dev_opp; 305 struct device_opp *dev_opp;
306 struct opp *temp_opp, *opp = ERR_PTR(-ERANGE); 306 struct opp *temp_opp, *opp = ERR_PTR(-ERANGE);
@@ -324,10 +324,10 @@ struct opp *opp_find_freq_ceil(struct device *dev, unsigned long *freq)
324 324
325 return opp; 325 return opp;
326} 326}
327EXPORT_SYMBOL_GPL(opp_find_freq_ceil); 327EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_ceil);
328 328
329/** 329/**
330 * opp_find_freq_floor() - Search for a rounded floor freq 330 * dev_pm_opp_find_freq_floor() - Search for a rounded floor freq
331 * @dev: device for which we do this operation 331 * @dev: device for which we do this operation
332 * @freq: Start frequency 332 * @freq: Start frequency
333 * 333 *
@@ -347,7 +347,7 @@ EXPORT_SYMBOL_GPL(opp_find_freq_ceil);
347 * under the locked area. The pointer returned must be used prior to unlocking 347 * 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. 348 * with rcu_read_unlock() to maintain the integrity of the pointer.
349 */ 349 */
350struct opp *opp_find_freq_floor(struct device *dev, unsigned long *freq) 350struct opp *dev_pm_opp_find_freq_floor(struct device *dev, unsigned long *freq)
351{ 351{
352 struct device_opp *dev_opp; 352 struct device_opp *dev_opp;
353 struct opp *temp_opp, *opp = ERR_PTR(-ERANGE); 353 struct opp *temp_opp, *opp = ERR_PTR(-ERANGE);
@@ -375,17 +375,17 @@ struct opp *opp_find_freq_floor(struct device *dev, unsigned long *freq)
375 375
376 return opp; 376 return opp;
377} 377}
378EXPORT_SYMBOL_GPL(opp_find_freq_floor); 378EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_floor);
379 379
380/** 380/**
381 * opp_add() - Add an OPP table from a table definitions 381 * dev_pm_opp_add() - Add an OPP table from a table definitions
382 * @dev: device for which we do this operation 382 * @dev: device for which we do this operation
383 * @freq: Frequency in Hz for this OPP 383 * @freq: Frequency in Hz for this OPP
384 * @u_volt: Voltage in uVolts for this OPP 384 * @u_volt: Voltage in uVolts for this OPP
385 * 385 *
386 * This function adds an opp definition to the opp list and returns status. 386 * This function adds an opp definition to the opp list and returns status.
387 * The opp is made available by default and it can be controlled using 387 * The opp is made available by default and it can be controlled using
388 * opp_enable/disable functions. 388 * dev_pm_opp_enable/disable functions.
389 * 389 *
390 * Locking: The internal device_opp and opp structures are RCU protected. 390 * Locking: The internal device_opp and opp structures are RCU protected.
391 * Hence this function internally uses RCU updater strategy with mutex locks 391 * Hence this function internally uses RCU updater strategy with mutex locks
@@ -393,7 +393,7 @@ EXPORT_SYMBOL_GPL(opp_find_freq_floor);
393 * that this function is *NOT* called under RCU protection or in contexts where 393 * that this function is *NOT* called under RCU protection or in contexts where
394 * mutex cannot be locked. 394 * mutex cannot be locked.
395 */ 395 */
396int opp_add(struct device *dev, unsigned long freq, unsigned long u_volt) 396int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
397{ 397{
398 struct device_opp *dev_opp = NULL; 398 struct device_opp *dev_opp = NULL;
399 struct opp *opp, *new_opp; 399 struct opp *opp, *new_opp;
@@ -460,7 +460,7 @@ int opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
460 srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_ADD, new_opp); 460 srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_ADD, new_opp);
461 return 0; 461 return 0;
462} 462}
463EXPORT_SYMBOL_GPL(opp_add); 463EXPORT_SYMBOL_GPL(dev_pm_opp_add);
464 464
465/** 465/**
466 * opp_set_availability() - helper to set the availability of an opp 466 * opp_set_availability() - helper to set the availability of an opp
@@ -552,13 +552,13 @@ unlock:
552} 552}
553 553
554/** 554/**
555 * opp_enable() - Enable a specific OPP 555 * dev_pm_opp_enable() - Enable a specific OPP
556 * @dev: device for which we do this operation 556 * @dev: device for which we do this operation
557 * @freq: OPP frequency to enable 557 * @freq: OPP frequency to enable
558 * 558 *
559 * Enables a provided opp. If the operation is valid, this returns 0, else the 559 * Enables a provided opp. If the operation is valid, this returns 0, else the
560 * corresponding error value. It is meant to be used for users an OPP available 560 * corresponding error value. It is meant to be used for users an OPP available
561 * after being temporarily made unavailable with opp_disable. 561 * after being temporarily made unavailable with dev_pm_opp_disable.
562 * 562 *
563 * Locking: The internal device_opp and opp structures are RCU protected. 563 * Locking: The internal device_opp and opp structures are RCU protected.
564 * Hence this function indirectly uses RCU and mutex locks to keep the 564 * Hence this function indirectly uses RCU and mutex locks to keep the
@@ -566,21 +566,21 @@ unlock:
566 * this function is *NOT* called under RCU protection or in contexts where 566 * this function is *NOT* called under RCU protection or in contexts where
567 * mutex locking or synchronize_rcu() blocking calls cannot be used. 567 * mutex locking or synchronize_rcu() blocking calls cannot be used.
568 */ 568 */
569int opp_enable(struct device *dev, unsigned long freq) 569int dev_pm_opp_enable(struct device *dev, unsigned long freq)
570{ 570{
571 return opp_set_availability(dev, freq, true); 571 return opp_set_availability(dev, freq, true);
572} 572}
573EXPORT_SYMBOL_GPL(opp_enable); 573EXPORT_SYMBOL_GPL(dev_pm_opp_enable);
574 574
575/** 575/**
576 * opp_disable() - Disable a specific OPP 576 * dev_pm_opp_disable() - Disable a specific OPP
577 * @dev: device for which we do this operation 577 * @dev: device for which we do this operation
578 * @freq: OPP frequency to disable 578 * @freq: OPP frequency to disable
579 * 579 *
580 * Disables a provided opp. If the operation is valid, this returns 580 * Disables a provided opp. If the operation is valid, this returns
581 * 0, else the corresponding error value. It is meant to be a temporary 581 * 0, else the corresponding error value. It is meant to be a temporary
582 * control by users to make this OPP not available until the circumstances are 582 * control by users to make this OPP not available until the circumstances are
583 * right to make it available again (with a call to opp_enable). 583 * right to make it available again (with a call to dev_pm_opp_enable).
584 * 584 *
585 * Locking: The internal device_opp and opp structures are RCU protected. 585 * Locking: The internal device_opp and opp structures are RCU protected.
586 * Hence this function indirectly uses RCU and mutex locks to keep the 586 * Hence this function indirectly uses RCU and mutex locks to keep the
@@ -588,15 +588,15 @@ EXPORT_SYMBOL_GPL(opp_enable);
588 * this function is *NOT* called under RCU protection or in contexts where 588 * this function is *NOT* called under RCU protection or in contexts where
589 * mutex locking or synchronize_rcu() blocking calls cannot be used. 589 * mutex locking or synchronize_rcu() blocking calls cannot be used.
590 */ 590 */
591int opp_disable(struct device *dev, unsigned long freq) 591int dev_pm_opp_disable(struct device *dev, unsigned long freq)
592{ 592{
593 return opp_set_availability(dev, freq, false); 593 return opp_set_availability(dev, freq, false);
594} 594}
595EXPORT_SYMBOL_GPL(opp_disable); 595EXPORT_SYMBOL_GPL(dev_pm_opp_disable);
596 596
597#ifdef CONFIG_CPU_FREQ 597#ifdef CONFIG_CPU_FREQ
598/** 598/**
599 * opp_init_cpufreq_table() - create a cpufreq table for a device 599 * dev_pm_opp_init_cpufreq_table() - create a cpufreq table for a device
600 * @dev: device for which we do this operation 600 * @dev: device for which we do this operation
601 * @table: Cpufreq table returned back to caller 601 * @table: Cpufreq table returned back to caller
602 * 602 *
@@ -619,7 +619,7 @@ EXPORT_SYMBOL_GPL(opp_disable);
619 * Callers should ensure that this function is *NOT* called under RCU protection 619 * Callers should ensure that this function is *NOT* called under RCU protection
620 * or in contexts where mutex locking cannot be used. 620 * or in contexts where mutex locking cannot be used.
621 */ 621 */
622int opp_init_cpufreq_table(struct device *dev, 622int dev_pm_opp_init_cpufreq_table(struct device *dev,
623 struct cpufreq_frequency_table **table) 623 struct cpufreq_frequency_table **table)
624{ 624{
625 struct device_opp *dev_opp; 625 struct device_opp *dev_opp;
@@ -639,7 +639,7 @@ int opp_init_cpufreq_table(struct device *dev,
639 } 639 }
640 640
641 freq_table = kzalloc(sizeof(struct cpufreq_frequency_table) * 641 freq_table = kzalloc(sizeof(struct cpufreq_frequency_table) *
642 (opp_get_opp_count(dev) + 1), GFP_KERNEL); 642 (dev_pm_opp_get_opp_count(dev) + 1), GFP_KERNEL);
643 if (!freq_table) { 643 if (!freq_table) {
644 mutex_unlock(&dev_opp_list_lock); 644 mutex_unlock(&dev_opp_list_lock);
645 dev_warn(dev, "%s: Unable to allocate frequency table\n", 645 dev_warn(dev, "%s: Unable to allocate frequency table\n",
@@ -663,16 +663,16 @@ int opp_init_cpufreq_table(struct device *dev,
663 663
664 return 0; 664 return 0;
665} 665}
666EXPORT_SYMBOL_GPL(opp_init_cpufreq_table); 666EXPORT_SYMBOL_GPL(dev_pm_opp_init_cpufreq_table);
667 667
668/** 668/**
669 * opp_free_cpufreq_table() - free the cpufreq table 669 * dev_pm_opp_free_cpufreq_table() - free the cpufreq table
670 * @dev: device for which we do this operation 670 * @dev: device for which we do this operation
671 * @table: table to free 671 * @table: table to free
672 * 672 *
673 * Free up the table allocated by opp_init_cpufreq_table 673 * Free up the table allocated by dev_pm_opp_init_cpufreq_table
674 */ 674 */
675void opp_free_cpufreq_table(struct device *dev, 675void dev_pm_opp_free_cpufreq_table(struct device *dev,
676 struct cpufreq_frequency_table **table) 676 struct cpufreq_frequency_table **table)
677{ 677{
678 if (!table) 678 if (!table)
@@ -681,14 +681,14 @@ void opp_free_cpufreq_table(struct device *dev,
681 kfree(*table); 681 kfree(*table);
682 *table = NULL; 682 *table = NULL;
683} 683}
684EXPORT_SYMBOL_GPL(opp_free_cpufreq_table); 684EXPORT_SYMBOL_GPL(dev_pm_opp_free_cpufreq_table);
685#endif /* CONFIG_CPU_FREQ */ 685#endif /* CONFIG_CPU_FREQ */
686 686
687/** 687/**
688 * opp_get_notifier() - find notifier_head of the device with opp 688 * dev_pm_opp_get_notifier() - find notifier_head of the device with opp
689 * @dev: device pointer used to lookup device OPPs. 689 * @dev: device pointer used to lookup device OPPs.
690 */ 690 */
691struct srcu_notifier_head *opp_get_notifier(struct device *dev) 691struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev)
692{ 692{
693 struct device_opp *dev_opp = find_device_opp(dev); 693 struct device_opp *dev_opp = find_device_opp(dev);
694 694
@@ -732,7 +732,7 @@ int of_init_opp_table(struct device *dev)
732 unsigned long freq = be32_to_cpup(val++) * 1000; 732 unsigned long freq = be32_to_cpup(val++) * 1000;
733 unsigned long volt = be32_to_cpup(val++); 733 unsigned long volt = be32_to_cpup(val++);
734 734
735 if (opp_add(dev, freq, volt)) { 735 if (dev_pm_opp_add(dev, freq, volt)) {
736 dev_warn(dev, "%s: Failed to add OPP %ld\n", 736 dev_warn(dev, "%s: Failed to add OPP %ld\n",
737 __func__, freq); 737 __func__, freq);
738 continue; 738 continue;
diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index 3549f0784af1..9e82a9d5df77 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -98,7 +98,7 @@ static void put_cluster_clk_and_freq_table(struct device *cpu_dev)
98 98
99 if (!atomic_dec_return(&cluster_usage[cluster])) { 99 if (!atomic_dec_return(&cluster_usage[cluster])) {
100 clk_put(clk[cluster]); 100 clk_put(clk[cluster]);
101 opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]); 101 dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]);
102 dev_dbg(cpu_dev, "%s: cluster: %d\n", __func__, cluster); 102 dev_dbg(cpu_dev, "%s: cluster: %d\n", __func__, cluster);
103 } 103 }
104} 104}
@@ -119,7 +119,7 @@ static int get_cluster_clk_and_freq_table(struct device *cpu_dev)
119 goto atomic_dec; 119 goto atomic_dec;
120 } 120 }
121 121
122 ret = opp_init_cpufreq_table(cpu_dev, &freq_table[cluster]); 122 ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table[cluster]);
123 if (ret) { 123 if (ret) {
124 dev_err(cpu_dev, "%s: failed to init cpufreq table, cpu: %d, err: %d\n", 124 dev_err(cpu_dev, "%s: failed to init cpufreq table, cpu: %d, err: %d\n",
125 __func__, cpu_dev->id, ret); 125 __func__, cpu_dev->id, ret);
@@ -138,7 +138,7 @@ static int get_cluster_clk_and_freq_table(struct device *cpu_dev)
138 dev_err(cpu_dev, "%s: Failed to get clk for cpu: %d, cluster: %d\n", 138 dev_err(cpu_dev, "%s: Failed to get clk for cpu: %d, cluster: %d\n",
139 __func__, cpu_dev->id, cluster); 139 __func__, cpu_dev->id, cluster);
140 ret = PTR_ERR(clk[cluster]); 140 ret = PTR_ERR(clk[cluster]);
141 opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]); 141 dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]);
142 142
143atomic_dec: 143atomic_dec:
144 atomic_dec(&cluster_usage[cluster]); 144 atomic_dec(&cluster_usage[cluster]);
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
index c522a95c0e16..af951a9cea78 100644
--- a/drivers/cpufreq/cpufreq-cpu0.c
+++ b/drivers/cpufreq/cpufreq-cpu0.c
@@ -72,7 +72,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy,
72 72
73 if (!IS_ERR(cpu_reg)) { 73 if (!IS_ERR(cpu_reg)) {
74 rcu_read_lock(); 74 rcu_read_lock();
75 opp = opp_find_freq_ceil(cpu_dev, &freq_Hz); 75 opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_Hz);
76 if (IS_ERR(opp)) { 76 if (IS_ERR(opp)) {
77 rcu_read_unlock(); 77 rcu_read_unlock();
78 pr_err("failed to find OPP for %ld\n", freq_Hz); 78 pr_err("failed to find OPP for %ld\n", freq_Hz);
@@ -80,7 +80,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy,
80 ret = PTR_ERR(opp); 80 ret = PTR_ERR(opp);
81 goto post_notify; 81 goto post_notify;
82 } 82 }
83 volt = opp_get_voltage(opp); 83 volt = dev_pm_opp_get_voltage(opp);
84 rcu_read_unlock(); 84 rcu_read_unlock();
85 tol = volt * voltage_tolerance / 100; 85 tol = volt * voltage_tolerance / 100;
86 volt_old = regulator_get_voltage(cpu_reg); 86 volt_old = regulator_get_voltage(cpu_reg);
@@ -218,7 +218,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
218 goto out_put_node; 218 goto out_put_node;
219 } 219 }
220 220
221 ret = opp_init_cpufreq_table(cpu_dev, &freq_table); 221 ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
222 if (ret) { 222 if (ret) {
223 pr_err("failed to init cpufreq table: %d\n", ret); 223 pr_err("failed to init cpufreq table: %d\n", ret);
224 goto out_put_node; 224 goto out_put_node;
@@ -242,12 +242,12 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
242 for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) 242 for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++)
243 ; 243 ;
244 rcu_read_lock(); 244 rcu_read_lock();
245 opp = opp_find_freq_exact(cpu_dev, 245 opp = dev_pm_opp_find_freq_exact(cpu_dev,
246 freq_table[0].frequency * 1000, true); 246 freq_table[0].frequency * 1000, true);
247 min_uV = opp_get_voltage(opp); 247 min_uV = dev_pm_opp_get_voltage(opp);
248 opp = opp_find_freq_exact(cpu_dev, 248 opp = dev_pm_opp_find_freq_exact(cpu_dev,
249 freq_table[i-1].frequency * 1000, true); 249 freq_table[i-1].frequency * 1000, true);
250 max_uV = opp_get_voltage(opp); 250 max_uV = dev_pm_opp_get_voltage(opp);
251 rcu_read_unlock(); 251 rcu_read_unlock();
252 ret = regulator_set_voltage_time(cpu_reg, min_uV, max_uV); 252 ret = regulator_set_voltage_time(cpu_reg, min_uV, max_uV);
253 if (ret > 0) 253 if (ret > 0)
@@ -264,7 +264,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
264 return 0; 264 return 0;
265 265
266out_free_table: 266out_free_table:
267 opp_free_cpufreq_table(cpu_dev, &freq_table); 267 dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
268out_put_node: 268out_put_node:
269 of_node_put(np); 269 of_node_put(np);
270 return ret; 270 return ret;
@@ -273,7 +273,7 @@ out_put_node:
273static int cpu0_cpufreq_remove(struct platform_device *pdev) 273static int cpu0_cpufreq_remove(struct platform_device *pdev)
274{ 274{
275 cpufreq_unregister_driver(&cpu0_cpufreq_driver); 275 cpufreq_unregister_driver(&cpu0_cpufreq_driver);
276 opp_free_cpufreq_table(cpu_dev, &freq_table); 276 dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
277 277
278 return 0; 278 return 0;
279} 279}
diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c
index be5380ecdcd4..444eca74d3c2 100644
--- a/drivers/cpufreq/exynos5440-cpufreq.c
+++ b/drivers/cpufreq/exynos5440-cpufreq.c
@@ -123,7 +123,7 @@ static int init_div_table(void)
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++) {
125 125
126 opp = opp_find_freq_exact(dvfs_info->dev, 126 opp = dev_pm_opp_find_freq_exact(dvfs_info->dev,
127 freq_tbl[i].frequency * 1000, true); 127 freq_tbl[i].frequency * 1000, true);
128 if (IS_ERR(opp)) { 128 if (IS_ERR(opp)) {
129 rcu_read_unlock(); 129 rcu_read_unlock();
@@ -142,7 +142,7 @@ static int init_div_table(void)
142 << P0_7_CSCLKDEV_SHIFT; 142 << P0_7_CSCLKDEV_SHIFT;
143 143
144 /* Calculate EMA */ 144 /* Calculate EMA */
145 volt_id = opp_get_voltage(opp); 145 volt_id = dev_pm_opp_get_voltage(opp);
146 volt_id = (MAX_VOLTAGE - volt_id) / VOLTAGE_STEP; 146 volt_id = (MAX_VOLTAGE - volt_id) / VOLTAGE_STEP;
147 if (volt_id < PMIC_HIGH_VOLT) { 147 if (volt_id < PMIC_HIGH_VOLT) {
148 ema_div = (CPUEMA_HIGH << P0_7_CPUEMA_SHIFT) | 148 ema_div = (CPUEMA_HIGH << P0_7_CPUEMA_SHIFT) |
@@ -399,13 +399,14 @@ static int exynos_cpufreq_probe(struct platform_device *pdev)
399 goto err_put_node; 399 goto err_put_node;
400 } 400 }
401 401
402 ret = opp_init_cpufreq_table(dvfs_info->dev, &dvfs_info->freq_table); 402 ret = dev_pm_opp_init_cpufreq_table(dvfs_info->dev,
403 &dvfs_info->freq_table);
403 if (ret) { 404 if (ret) {
404 dev_err(dvfs_info->dev, 405 dev_err(dvfs_info->dev,
405 "failed to init cpufreq table: %d\n", ret); 406 "failed to init cpufreq table: %d\n", ret);
406 goto err_put_node; 407 goto err_put_node;
407 } 408 }
408 dvfs_info->freq_count = opp_get_opp_count(dvfs_info->dev); 409 dvfs_info->freq_count = dev_pm_opp_get_opp_count(dvfs_info->dev);
409 exynos_sort_descend_freq_table(); 410 exynos_sort_descend_freq_table();
410 411
411 if (of_property_read_u32(np, "clock-latency", &dvfs_info->latency)) 412 if (of_property_read_u32(np, "clock-latency", &dvfs_info->latency))
@@ -454,7 +455,7 @@ static int exynos_cpufreq_probe(struct platform_device *pdev)
454 return 0; 455 return 0;
455 456
456err_free_table: 457err_free_table:
457 opp_free_cpufreq_table(dvfs_info->dev, &dvfs_info->freq_table); 458 dev_pm_opp_free_cpufreq_table(dvfs_info->dev, &dvfs_info->freq_table);
458err_put_node: 459err_put_node:
459 of_node_put(np); 460 of_node_put(np);
460 dev_err(&pdev->dev, "%s: failed initialization\n", __func__); 461 dev_err(&pdev->dev, "%s: failed initialization\n", __func__);
@@ -464,7 +465,7 @@ err_put_node:
464static int exynos_cpufreq_remove(struct platform_device *pdev) 465static int exynos_cpufreq_remove(struct platform_device *pdev)
465{ 466{
466 cpufreq_unregister_driver(&exynos_driver); 467 cpufreq_unregister_driver(&exynos_driver);
467 opp_free_cpufreq_table(dvfs_info->dev, &dvfs_info->freq_table); 468 dev_pm_opp_free_cpufreq_table(dvfs_info->dev, &dvfs_info->freq_table);
468 return 0; 469 return 0;
469} 470}
470 471
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
index c3fd2a101ca0..b360549e7715 100644
--- a/drivers/cpufreq/imx6q-cpufreq.c
+++ b/drivers/cpufreq/imx6q-cpufreq.c
@@ -70,14 +70,14 @@ static int imx6q_set_target(struct cpufreq_policy *policy,
70 return 0; 70 return 0;
71 71
72 rcu_read_lock(); 72 rcu_read_lock();
73 opp = opp_find_freq_ceil(cpu_dev, &freq_hz); 73 opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_hz);
74 if (IS_ERR(opp)) { 74 if (IS_ERR(opp)) {
75 rcu_read_unlock(); 75 rcu_read_unlock();
76 dev_err(cpu_dev, "failed to find OPP for %ld\n", freq_hz); 76 dev_err(cpu_dev, "failed to find OPP for %ld\n", freq_hz);
77 return PTR_ERR(opp); 77 return PTR_ERR(opp);
78 } 78 }
79 79
80 volt = opp_get_voltage(opp); 80 volt = dev_pm_opp_get_voltage(opp);
81 rcu_read_unlock(); 81 rcu_read_unlock();
82 volt_old = regulator_get_voltage(arm_reg); 82 volt_old = regulator_get_voltage(arm_reg);
83 83
@@ -237,14 +237,14 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
237 } 237 }
238 238
239 /* We expect an OPP table supplied by platform */ 239 /* We expect an OPP table supplied by platform */
240 num = opp_get_opp_count(cpu_dev); 240 num = dev_pm_opp_get_opp_count(cpu_dev);
241 if (num < 0) { 241 if (num < 0) {
242 ret = num; 242 ret = num;
243 dev_err(cpu_dev, "no OPP table is found: %d\n", ret); 243 dev_err(cpu_dev, "no OPP table is found: %d\n", ret);
244 goto put_node; 244 goto put_node;
245 } 245 }
246 246
247 ret = opp_init_cpufreq_table(cpu_dev, &freq_table); 247 ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
248 if (ret) { 248 if (ret) {
249 dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret); 249 dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret);
250 goto put_node; 250 goto put_node;
@@ -259,12 +259,12 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
259 * same order. 259 * same order.
260 */ 260 */
261 rcu_read_lock(); 261 rcu_read_lock();
262 opp = opp_find_freq_exact(cpu_dev, 262 opp = dev_pm_opp_find_freq_exact(cpu_dev,
263 freq_table[0].frequency * 1000, true); 263 freq_table[0].frequency * 1000, true);
264 min_volt = opp_get_voltage(opp); 264 min_volt = dev_pm_opp_get_voltage(opp);
265 opp = opp_find_freq_exact(cpu_dev, 265 opp = dev_pm_opp_find_freq_exact(cpu_dev,
266 freq_table[--num].frequency * 1000, true); 266 freq_table[--num].frequency * 1000, true);
267 max_volt = opp_get_voltage(opp); 267 max_volt = dev_pm_opp_get_voltage(opp);
268 rcu_read_unlock(); 268 rcu_read_unlock();
269 ret = regulator_set_voltage_time(arm_reg, min_volt, max_volt); 269 ret = regulator_set_voltage_time(arm_reg, min_volt, max_volt);
270 if (ret > 0) 270 if (ret > 0)
@@ -292,7 +292,7 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
292 return 0; 292 return 0;
293 293
294free_freq_table: 294free_freq_table:
295 opp_free_cpufreq_table(cpu_dev, &freq_table); 295 dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
296put_node: 296put_node:
297 of_node_put(np); 297 of_node_put(np);
298 return ret; 298 return ret;
@@ -301,7 +301,7 @@ put_node:
301static int imx6q_cpufreq_remove(struct platform_device *pdev) 301static int imx6q_cpufreq_remove(struct platform_device *pdev)
302{ 302{
303 cpufreq_unregister_driver(&imx6q_cpufreq_driver); 303 cpufreq_unregister_driver(&imx6q_cpufreq_driver);
304 opp_free_cpufreq_table(cpu_dev, &freq_table); 304 dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
305 305
306 return 0; 306 return 0;
307} 307}
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
index f31fcfcad514..c5e31d296607 100644
--- a/drivers/cpufreq/omap-cpufreq.c
+++ b/drivers/cpufreq/omap-cpufreq.c
@@ -105,14 +105,14 @@ static int omap_target(struct cpufreq_policy *policy,
105 105
106 if (mpu_reg) { 106 if (mpu_reg) {
107 rcu_read_lock(); 107 rcu_read_lock();
108 opp = opp_find_freq_ceil(mpu_dev, &freq); 108 opp = dev_pm_opp_find_freq_ceil(mpu_dev, &freq);
109 if (IS_ERR(opp)) { 109 if (IS_ERR(opp)) {
110 rcu_read_unlock(); 110 rcu_read_unlock();
111 dev_err(mpu_dev, "%s: unable to find MPU OPP for %d\n", 111 dev_err(mpu_dev, "%s: unable to find MPU OPP for %d\n",
112 __func__, freqs.new); 112 __func__, freqs.new);
113 return -EINVAL; 113 return -EINVAL;
114 } 114 }
115 volt = opp_get_voltage(opp); 115 volt = dev_pm_opp_get_voltage(opp);
116 rcu_read_unlock(); 116 rcu_read_unlock();
117 tol = volt * OPP_TOLERANCE / 100; 117 tol = volt * OPP_TOLERANCE / 100;
118 volt_old = regulator_get_voltage(mpu_reg); 118 volt_old = regulator_get_voltage(mpu_reg);
@@ -162,7 +162,7 @@ done:
162static inline void freq_table_free(void) 162static inline void freq_table_free(void)
163{ 163{
164 if (atomic_dec_and_test(&freq_table_users)) 164 if (atomic_dec_and_test(&freq_table_users))
165 opp_free_cpufreq_table(mpu_dev, &freq_table); 165 dev_pm_opp_free_cpufreq_table(mpu_dev, &freq_table);
166} 166}
167 167
168static int omap_cpu_init(struct cpufreq_policy *policy) 168static int omap_cpu_init(struct cpufreq_policy *policy)
@@ -181,7 +181,7 @@ static int omap_cpu_init(struct cpufreq_policy *policy)
181 policy->cur = omap_getspeed(policy->cpu); 181 policy->cur = omap_getspeed(policy->cpu);
182 182
183 if (!freq_table) 183 if (!freq_table)
184 result = opp_init_cpufreq_table(mpu_dev, &freq_table); 184 result = dev_pm_opp_init_cpufreq_table(mpu_dev, &freq_table);
185 185
186 if (result) { 186 if (result) {
187 dev_err(mpu_dev, "%s: cpu%d: failed creating freq table[%d]\n", 187 dev_err(mpu_dev, "%s: cpu%d: failed creating freq table[%d]\n",
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index c99c00d35d34..f798edcb910d 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -908,7 +908,7 @@ static ssize_t available_frequencies_show(struct device *d,
908 908
909 rcu_read_lock(); 909 rcu_read_lock();
910 do { 910 do {
911 opp = opp_find_freq_ceil(dev, &freq); 911 opp = dev_pm_opp_find_freq_ceil(dev, &freq);
912 if (IS_ERR(opp)) 912 if (IS_ERR(opp))
913 break; 913 break;
914 914
@@ -1036,18 +1036,18 @@ struct opp *devfreq_recommended_opp(struct device *dev, unsigned long *freq,
1036 1036
1037 if (flags & DEVFREQ_FLAG_LEAST_UPPER_BOUND) { 1037 if (flags & DEVFREQ_FLAG_LEAST_UPPER_BOUND) {
1038 /* The freq is an upper bound. opp should be lower */ 1038 /* The freq is an upper bound. opp should be lower */
1039 opp = opp_find_freq_floor(dev, freq); 1039 opp = dev_pm_opp_find_freq_floor(dev, freq);
1040 1040
1041 /* If not available, use the closest opp */ 1041 /* If not available, use the closest opp */
1042 if (opp == ERR_PTR(-ERANGE)) 1042 if (opp == ERR_PTR(-ERANGE))
1043 opp = opp_find_freq_ceil(dev, freq); 1043 opp = dev_pm_opp_find_freq_ceil(dev, freq);
1044 } else { 1044 } else {
1045 /* The freq is an lower bound. opp should be higher */ 1045 /* The freq is an lower bound. opp should be higher */
1046 opp = opp_find_freq_ceil(dev, freq); 1046 opp = dev_pm_opp_find_freq_ceil(dev, freq);
1047 1047
1048 /* If not available, use the closest opp */ 1048 /* If not available, use the closest opp */
1049 if (opp == ERR_PTR(-ERANGE)) 1049 if (opp == ERR_PTR(-ERANGE))
1050 opp = opp_find_freq_floor(dev, freq); 1050 opp = dev_pm_opp_find_freq_floor(dev, freq);
1051 } 1051 }
1052 1052
1053 return opp; 1053 return opp;
@@ -1066,7 +1066,7 @@ int devfreq_register_opp_notifier(struct device *dev, struct devfreq *devfreq)
1066 int ret = 0; 1066 int ret = 0;
1067 1067
1068 rcu_read_lock(); 1068 rcu_read_lock();
1069 nh = opp_get_notifier(dev); 1069 nh = dev_pm_opp_get_notifier(dev);
1070 if (IS_ERR(nh)) 1070 if (IS_ERR(nh))
1071 ret = PTR_ERR(nh); 1071 ret = PTR_ERR(nh);
1072 rcu_read_unlock(); 1072 rcu_read_unlock();
@@ -1092,7 +1092,7 @@ int devfreq_unregister_opp_notifier(struct device *dev, struct devfreq *devfreq)
1092 int ret = 0; 1092 int ret = 0;
1093 1093
1094 rcu_read_lock(); 1094 rcu_read_lock();
1095 nh = opp_get_notifier(dev); 1095 nh = dev_pm_opp_get_notifier(dev);
1096 if (IS_ERR(nh)) 1096 if (IS_ERR(nh))
1097 ret = PTR_ERR(nh); 1097 ret = PTR_ERR(nh);
1098 rcu_read_unlock(); 1098 rcu_read_unlock();
diff --git a/drivers/devfreq/exynos/exynos4_bus.c b/drivers/devfreq/exynos/exynos4_bus.c
index c5f86d8caca3..33c0e05a5ff1 100644
--- a/drivers/devfreq/exynos/exynos4_bus.c
+++ b/drivers/devfreq/exynos/exynos4_bus.c
@@ -650,8 +650,8 @@ static int exynos4_bus_target(struct device *dev, unsigned long *_freq,
650 rcu_read_unlock(); 650 rcu_read_unlock();
651 return PTR_ERR(opp); 651 return PTR_ERR(opp);
652 } 652 }
653 new_oppinfo.rate = opp_get_freq(opp); 653 new_oppinfo.rate = dev_pm_opp_get_freq(opp);
654 new_oppinfo.volt = opp_get_voltage(opp); 654 new_oppinfo.volt = dev_pm_opp_get_voltage(opp);
655 rcu_read_unlock(); 655 rcu_read_unlock();
656 freq = new_oppinfo.rate; 656 freq = new_oppinfo.rate;
657 657
@@ -873,7 +873,7 @@ static int exynos4210_init_tables(struct busfreq_data *data)
873 exynos4210_busclk_table[i].volt = exynos4210_asv_volt[mgrp][i]; 873 exynos4210_busclk_table[i].volt = exynos4210_asv_volt[mgrp][i];
874 874
875 for (i = LV_0; i < EX4210_LV_NUM; i++) { 875 for (i = LV_0; i < EX4210_LV_NUM; i++) {
876 err = opp_add(data->dev, exynos4210_busclk_table[i].clk, 876 err = dev_pm_opp_add(data->dev, exynos4210_busclk_table[i].clk,
877 exynos4210_busclk_table[i].volt); 877 exynos4210_busclk_table[i].volt);
878 if (err) { 878 if (err) {
879 dev_err(data->dev, "Cannot add opp entries.\n"); 879 dev_err(data->dev, "Cannot add opp entries.\n");
@@ -940,7 +940,7 @@ static int exynos4x12_init_tables(struct busfreq_data *data)
940 } 940 }
941 941
942 for (i = 0; i < EX4x12_LV_NUM; i++) { 942 for (i = 0; i < EX4x12_LV_NUM; i++) {
943 ret = opp_add(data->dev, exynos4x12_mifclk_table[i].clk, 943 ret = dev_pm_opp_add(data->dev, exynos4x12_mifclk_table[i].clk,
944 exynos4x12_mifclk_table[i].volt); 944 exynos4x12_mifclk_table[i].volt);
945 if (ret) { 945 if (ret) {
946 dev_err(data->dev, "Fail to add opp entries.\n"); 946 dev_err(data->dev, "Fail to add opp entries.\n");
@@ -969,7 +969,7 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this,
969 data->disabled = true; 969 data->disabled = true;
970 970
971 rcu_read_lock(); 971 rcu_read_lock();
972 opp = opp_find_freq_floor(data->dev, &maxfreq); 972 opp = dev_pm_opp_find_freq_floor(data->dev, &maxfreq);
973 if (IS_ERR(opp)) { 973 if (IS_ERR(opp)) {
974 rcu_read_unlock(); 974 rcu_read_unlock();
975 dev_err(data->dev, "%s: unable to find a min freq\n", 975 dev_err(data->dev, "%s: unable to find a min freq\n",
@@ -977,8 +977,8 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this,
977 mutex_unlock(&data->lock); 977 mutex_unlock(&data->lock);
978 return PTR_ERR(opp); 978 return PTR_ERR(opp);
979 } 979 }
980 new_oppinfo.rate = opp_get_freq(opp); 980 new_oppinfo.rate = dev_pm_opp_get_freq(opp);
981 new_oppinfo.volt = opp_get_voltage(opp); 981 new_oppinfo.volt = dev_pm_opp_get_voltage(opp);
982 rcu_read_unlock(); 982 rcu_read_unlock();
983 983
984 err = exynos4_bus_setvolt(data, &new_oppinfo, 984 err = exynos4_bus_setvolt(data, &new_oppinfo,
@@ -1065,15 +1065,16 @@ static int exynos4_busfreq_probe(struct platform_device *pdev)
1065 } 1065 }
1066 1066
1067 rcu_read_lock(); 1067 rcu_read_lock();
1068 opp = opp_find_freq_floor(dev, &exynos4_devfreq_profile.initial_freq); 1068 opp = dev_pm_opp_find_freq_floor(dev,
1069 &exynos4_devfreq_profile.initial_freq);
1069 if (IS_ERR(opp)) { 1070 if (IS_ERR(opp)) {
1070 rcu_read_unlock(); 1071 rcu_read_unlock();
1071 dev_err(dev, "Invalid initial frequency %lu kHz.\n", 1072 dev_err(dev, "Invalid initial frequency %lu kHz.\n",
1072 exynos4_devfreq_profile.initial_freq); 1073 exynos4_devfreq_profile.initial_freq);
1073 return PTR_ERR(opp); 1074 return PTR_ERR(opp);
1074 } 1075 }
1075 data->curr_oppinfo.rate = opp_get_freq(opp); 1076 data->curr_oppinfo.rate = dev_pm_opp_get_freq(opp);
1076 data->curr_oppinfo.volt = opp_get_voltage(opp); 1077 data->curr_oppinfo.volt = dev_pm_opp_get_voltage(opp);
1077 rcu_read_unlock(); 1078 rcu_read_unlock();
1078 1079
1079 platform_set_drvdata(pdev, data); 1080 platform_set_drvdata(pdev, data);
diff --git a/drivers/devfreq/exynos/exynos5_bus.c b/drivers/devfreq/exynos/exynos5_bus.c
index 574b16b59be5..b0e45925505b 100644
--- a/drivers/devfreq/exynos/exynos5_bus.c
+++ b/drivers/devfreq/exynos/exynos5_bus.c
@@ -144,8 +144,8 @@ static int exynos5_busfreq_int_target(struct device *dev, unsigned long *_freq,
144 return PTR_ERR(opp); 144 return PTR_ERR(opp);
145 } 145 }
146 146
147 freq = opp_get_freq(opp); 147 freq = dev_pm_opp_get_freq(opp);
148 volt = opp_get_voltage(opp); 148 volt = dev_pm_opp_get_voltage(opp);
149 rcu_read_unlock(); 149 rcu_read_unlock();
150 150
151 old_freq = data->curr_freq; 151 old_freq = data->curr_freq;
@@ -246,7 +246,7 @@ static int exynos5250_init_int_tables(struct busfreq_data_int *data)
246 int i, err = 0; 246 int i, err = 0;
247 247
248 for (i = LV_0; i < _LV_END; i++) { 248 for (i = LV_0; i < _LV_END; i++) {
249 err = opp_add(data->dev, exynos5_int_opp_table[i].clk, 249 err = dev_pm_opp_add(data->dev, exynos5_int_opp_table[i].clk,
250 exynos5_int_opp_table[i].volt); 250 exynos5_int_opp_table[i].volt);
251 if (err) { 251 if (err) {
252 dev_err(data->dev, "Cannot add opp entries.\n"); 252 dev_err(data->dev, "Cannot add opp entries.\n");
@@ -276,14 +276,14 @@ static int exynos5_busfreq_int_pm_notifier_event(struct notifier_block *this,
276 data->disabled = true; 276 data->disabled = true;
277 277
278 rcu_read_lock(); 278 rcu_read_lock();
279 opp = opp_find_freq_floor(data->dev, &maxfreq); 279 opp = dev_pm_opp_find_freq_floor(data->dev, &maxfreq);
280 if (IS_ERR(opp)) { 280 if (IS_ERR(opp)) {
281 rcu_read_unlock(); 281 rcu_read_unlock();
282 err = PTR_ERR(opp); 282 err = PTR_ERR(opp);
283 goto unlock; 283 goto unlock;
284 } 284 }
285 freq = opp_get_freq(opp); 285 freq = dev_pm_opp_get_freq(opp);
286 volt = opp_get_voltage(opp); 286 volt = dev_pm_opp_get_voltage(opp);
287 rcu_read_unlock(); 287 rcu_read_unlock();
288 288
289 err = exynos5_int_setvolt(data, volt); 289 err = exynos5_int_setvolt(data, volt);
@@ -368,7 +368,7 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev)
368 } 368 }
369 369
370 rcu_read_lock(); 370 rcu_read_lock();
371 opp = opp_find_freq_floor(dev, 371 opp = dev_pm_opp_find_freq_floor(dev,
372 &exynos5_devfreq_int_profile.initial_freq); 372 &exynos5_devfreq_int_profile.initial_freq);
373 if (IS_ERR(opp)) { 373 if (IS_ERR(opp)) {
374 rcu_read_unlock(); 374 rcu_read_unlock();
@@ -377,8 +377,8 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev)
377 err = PTR_ERR(opp); 377 err = PTR_ERR(opp);
378 goto err_opp_add; 378 goto err_opp_add;
379 } 379 }
380 initial_freq = opp_get_freq(opp); 380 initial_freq = dev_pm_opp_get_freq(opp);
381 initial_volt = opp_get_voltage(opp); 381 initial_volt = dev_pm_opp_get_voltage(opp);
382 rcu_read_unlock(); 382 rcu_read_unlock();
383 data->curr_freq = initial_freq; 383 data->curr_freq = initial_freq;
384 384