diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-08-28 01:52:27 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-09-08 19:44:40 -0400 |
commit | fbd48ca5911b3cd70da57c3313d13004e40aea54 (patch) | |
tree | df0c9702db3deb6f968b3c7897d619dca690ebc2 /drivers/cpufreq/cpufreq-cpu0.c | |
parent | 48a8624b3abe39bd66490e3ab692a74a73b582eb (diff) |
cpufreq: cpu0: use dev_{err|warn|dbg} instead of pr_{err|warn|debug}
We already have cpu_dev and is used at multiple places for printing errors using
dev_*(). But some prints are still using pr_*(). Lets make it consistent and
replace those pr_*() macros with dev_*() macros.
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq-cpu0.c')
-rw-r--r-- | drivers/cpufreq/cpufreq-cpu0.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index eb07e3f996b3..741ff220f9bf 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c | |||
@@ -58,7 +58,8 @@ static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index) | |||
58 | opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_Hz); | 58 | opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_Hz); |
59 | if (IS_ERR(opp)) { | 59 | if (IS_ERR(opp)) { |
60 | rcu_read_unlock(); | 60 | rcu_read_unlock(); |
61 | pr_err("failed to find OPP for %ld\n", freq_Hz); | 61 | dev_err(cpu_dev, "failed to find OPP for %ld\n", |
62 | freq_Hz); | ||
62 | return PTR_ERR(opp); | 63 | return PTR_ERR(opp); |
63 | } | 64 | } |
64 | volt = dev_pm_opp_get_voltage(opp); | 65 | volt = dev_pm_opp_get_voltage(opp); |
@@ -67,22 +68,23 @@ static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index) | |||
67 | volt_old = regulator_get_voltage(cpu_reg); | 68 | volt_old = regulator_get_voltage(cpu_reg); |
68 | } | 69 | } |
69 | 70 | ||
70 | pr_debug("%u MHz, %ld mV --> %u MHz, %ld mV\n", | 71 | dev_dbg(cpu_dev, "%u MHz, %ld mV --> %u MHz, %ld mV\n", |
71 | old_freq / 1000, volt_old ? volt_old / 1000 : -1, | 72 | old_freq / 1000, volt_old ? volt_old / 1000 : -1, |
72 | new_freq / 1000, volt ? volt / 1000 : -1); | 73 | new_freq / 1000, volt ? volt / 1000 : -1); |
73 | 74 | ||
74 | /* scaling up? scale voltage before frequency */ | 75 | /* scaling up? scale voltage before frequency */ |
75 | if (!IS_ERR(cpu_reg) && new_freq > old_freq) { | 76 | if (!IS_ERR(cpu_reg) && new_freq > old_freq) { |
76 | ret = regulator_set_voltage_tol(cpu_reg, volt, tol); | 77 | ret = regulator_set_voltage_tol(cpu_reg, volt, tol); |
77 | if (ret) { | 78 | if (ret) { |
78 | pr_err("failed to scale voltage up: %d\n", ret); | 79 | dev_err(cpu_dev, "failed to scale voltage up: %d\n", |
80 | ret); | ||
79 | return ret; | 81 | return ret; |
80 | } | 82 | } |
81 | } | 83 | } |
82 | 84 | ||
83 | ret = clk_set_rate(cpu_clk, freq_exact); | 85 | ret = clk_set_rate(cpu_clk, freq_exact); |
84 | if (ret) { | 86 | if (ret) { |
85 | pr_err("failed to set clock rate: %d\n", ret); | 87 | dev_err(cpu_dev, "failed to set clock rate: %d\n", ret); |
86 | if (!IS_ERR(cpu_reg)) | 88 | if (!IS_ERR(cpu_reg)) |
87 | regulator_set_voltage_tol(cpu_reg, volt_old, tol); | 89 | regulator_set_voltage_tol(cpu_reg, volt_old, tol); |
88 | return ret; | 90 | return ret; |
@@ -92,7 +94,8 @@ static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index) | |||
92 | if (!IS_ERR(cpu_reg) && new_freq < old_freq) { | 94 | if (!IS_ERR(cpu_reg) && new_freq < old_freq) { |
93 | ret = regulator_set_voltage_tol(cpu_reg, volt, tol); | 95 | ret = regulator_set_voltage_tol(cpu_reg, volt, tol); |
94 | if (ret) { | 96 | if (ret) { |
95 | pr_err("failed to scale voltage down: %d\n", ret); | 97 | dev_err(cpu_dev, "failed to scale voltage down: %d\n", |
98 | ret); | ||
96 | clk_set_rate(cpu_clk, old_freq * 1000); | 99 | clk_set_rate(cpu_clk, old_freq * 1000); |
97 | } | 100 | } |
98 | } | 101 | } |
@@ -129,7 +132,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) | |||
129 | 132 | ||
130 | np = of_node_get(cpu_dev->of_node); | 133 | np = of_node_get(cpu_dev->of_node); |
131 | if (!np) { | 134 | if (!np) { |
132 | pr_err("failed to find cpu0 node\n"); | 135 | dev_err(cpu_dev, "failed to find cpu0 node\n"); |
133 | return -ENOENT; | 136 | return -ENOENT; |
134 | } | 137 | } |
135 | 138 | ||
@@ -144,8 +147,8 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) | |||
144 | ret = -EPROBE_DEFER; | 147 | ret = -EPROBE_DEFER; |
145 | goto out_put_node; | 148 | goto out_put_node; |
146 | } | 149 | } |
147 | pr_warn("failed to get cpu0 regulator: %ld\n", | 150 | dev_warn(cpu_dev, "failed to get cpu0 regulator: %ld\n", |
148 | PTR_ERR(cpu_reg)); | 151 | PTR_ERR(cpu_reg)); |
149 | } | 152 | } |
150 | 153 | ||
151 | cpu_clk = clk_get(cpu_dev, NULL); | 154 | cpu_clk = clk_get(cpu_dev, NULL); |
@@ -169,7 +172,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) | |||
169 | 172 | ||
170 | ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); | 173 | ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); |
171 | if (ret) { | 174 | if (ret) { |
172 | pr_err("failed to init cpufreq table: %d\n", ret); | 175 | dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret); |
173 | goto out_put_clk; | 176 | goto out_put_clk; |
174 | } | 177 | } |
175 | 178 | ||
@@ -205,7 +208,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) | |||
205 | 208 | ||
206 | ret = cpufreq_register_driver(&cpu0_cpufreq_driver); | 209 | ret = cpufreq_register_driver(&cpu0_cpufreq_driver); |
207 | if (ret) { | 210 | if (ret) { |
208 | pr_err("failed register driver: %d\n", ret); | 211 | dev_err(cpu_dev, "failed to register driver: %d\n", ret); |
209 | goto out_free_table; | 212 | goto out_free_table; |
210 | } | 213 | } |
211 | 214 | ||
@@ -216,8 +219,9 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) | |||
216 | if (of_find_property(np, "#cooling-cells", NULL)) { | 219 | if (of_find_property(np, "#cooling-cells", NULL)) { |
217 | cdev = of_cpufreq_cooling_register(np, cpu_present_mask); | 220 | cdev = of_cpufreq_cooling_register(np, cpu_present_mask); |
218 | if (IS_ERR(cdev)) | 221 | if (IS_ERR(cdev)) |
219 | pr_err("running cpufreq without cooling device: %ld\n", | 222 | dev_err(cpu_dev, |
220 | PTR_ERR(cdev)); | 223 | "running cpufreq without cooling device: %ld\n", |
224 | PTR_ERR(cdev)); | ||
221 | } | 225 | } |
222 | 226 | ||
223 | of_node_put(np); | 227 | of_node_put(np); |