diff options
author | Kevin Hilman <khilman@ti.com> | 2011-07-21 12:58:36 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-09-15 19:35:45 -0400 |
commit | 49882c99401fa2777157908479169accf039cab7 (patch) | |
tree | 7f4f9de2e23019d6ccda82f81775ca5bf8bd6ccc | |
parent | 796ba283b076466df0b10b6ee54af45b9c1d4d04 (diff) |
OMAP: omap_device: replace debug/warning/error prints with dev_* macros
For consistency in kernel printk output for devices, use dev_dbg(),
dev_warn(), dev_err() instead of pr_debug(), pr_warning() and
pr_err(), some of which currently use direct access of name from
platform_device and others of which use dev_name(). Using the dev_*
versions uses the standard device naming from the driver core.
Some pr_* prints were not converted with this patch since they are
used before the platform_device and struct device are created so
neither the dev_* prints or dev_name() is valid.
Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 85 |
1 files changed, 42 insertions, 43 deletions
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index 02609eee0562..334bfd27f530 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c | |||
@@ -114,7 +114,7 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat) | |||
114 | { | 114 | { |
115 | struct timespec a, b, c; | 115 | struct timespec a, b, c; |
116 | 116 | ||
117 | pr_debug("omap_device: %s: activating\n", od->pdev.name); | 117 | dev_dbg(&od->pdev.dev, "omap_device: activating\n"); |
118 | 118 | ||
119 | while (od->pm_lat_level > 0) { | 119 | while (od->pm_lat_level > 0) { |
120 | struct omap_device_pm_latency *odpl; | 120 | struct omap_device_pm_latency *odpl; |
@@ -138,25 +138,24 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat) | |||
138 | c = timespec_sub(b, a); | 138 | c = timespec_sub(b, a); |
139 | act_lat = timespec_to_ns(&c); | 139 | act_lat = timespec_to_ns(&c); |
140 | 140 | ||
141 | pr_debug("omap_device: %s: pm_lat %d: activate: elapsed time " | 141 | dev_dbg(&od->pdev.dev, |
142 | "%llu nsec\n", od->pdev.name, od->pm_lat_level, | 142 | "omap_device: pm_lat %d: activate: elapsed time " |
143 | act_lat); | 143 | "%llu nsec\n", od->pm_lat_level, act_lat); |
144 | 144 | ||
145 | if (act_lat > odpl->activate_lat) { | 145 | if (act_lat > odpl->activate_lat) { |
146 | odpl->activate_lat_worst = act_lat; | 146 | odpl->activate_lat_worst = act_lat; |
147 | if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { | 147 | if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { |
148 | odpl->activate_lat = act_lat; | 148 | odpl->activate_lat = act_lat; |
149 | pr_warning("omap_device: %s.%d: new worst case " | 149 | dev_warn(&od->pdev.dev, |
150 | "activate latency %d: %llu\n", | 150 | "new worst case activate latency " |
151 | od->pdev.name, od->pdev.id, | 151 | "%d: %llu\n", |
152 | od->pm_lat_level, act_lat); | 152 | od->pm_lat_level, act_lat); |
153 | } else | 153 | } else |
154 | pr_warning("omap_device: %s.%d: activate " | 154 | dev_warn(&od->pdev.dev, |
155 | "latency %d higher than exptected. " | 155 | "activate latency %d " |
156 | "(%llu > %d)\n", | 156 | "higher than exptected. (%llu > %d)\n", |
157 | od->pdev.name, od->pdev.id, | 157 | od->pm_lat_level, act_lat, |
158 | od->pm_lat_level, act_lat, | 158 | odpl->activate_lat); |
159 | odpl->activate_lat); | ||
160 | } | 159 | } |
161 | 160 | ||
162 | od->dev_wakeup_lat -= odpl->activate_lat; | 161 | od->dev_wakeup_lat -= odpl->activate_lat; |
@@ -183,7 +182,7 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat) | |||
183 | { | 182 | { |
184 | struct timespec a, b, c; | 183 | struct timespec a, b, c; |
185 | 184 | ||
186 | pr_debug("omap_device: %s: deactivating\n", od->pdev.name); | 185 | dev_dbg(&od->pdev.dev, "omap_device: deactivating\n"); |
187 | 186 | ||
188 | while (od->pm_lat_level < od->pm_lats_cnt) { | 187 | while (od->pm_lat_level < od->pm_lats_cnt) { |
189 | struct omap_device_pm_latency *odpl; | 188 | struct omap_device_pm_latency *odpl; |
@@ -206,28 +205,26 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat) | |||
206 | c = timespec_sub(b, a); | 205 | c = timespec_sub(b, a); |
207 | deact_lat = timespec_to_ns(&c); | 206 | deact_lat = timespec_to_ns(&c); |
208 | 207 | ||
209 | pr_debug("omap_device: %s: pm_lat %d: deactivate: elapsed time " | 208 | dev_dbg(&od->pdev.dev, |
210 | "%llu nsec\n", od->pdev.name, od->pm_lat_level, | 209 | "omap_device: pm_lat %d: deactivate: elapsed time " |
211 | deact_lat); | 210 | "%llu nsec\n", od->pm_lat_level, deact_lat); |
212 | 211 | ||
213 | if (deact_lat > odpl->deactivate_lat) { | 212 | if (deact_lat > odpl->deactivate_lat) { |
214 | odpl->deactivate_lat_worst = deact_lat; | 213 | odpl->deactivate_lat_worst = deact_lat; |
215 | if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { | 214 | if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { |
216 | odpl->deactivate_lat = deact_lat; | 215 | odpl->deactivate_lat = deact_lat; |
217 | pr_warning("omap_device: %s.%d: new worst case " | 216 | dev_warn(&od->pdev.dev, |
218 | "deactivate latency %d: %llu\n", | 217 | "new worst case deactivate latency " |
219 | od->pdev.name, od->pdev.id, | 218 | "%d: %llu\n", |
220 | od->pm_lat_level, deact_lat); | 219 | od->pm_lat_level, deact_lat); |
221 | } else | 220 | } else |
222 | pr_warning("omap_device: %s.%d: deactivate " | 221 | dev_warn(&od->pdev.dev, |
223 | "latency %d higher than exptected. " | 222 | "deactivate latency %d " |
224 | "(%llu > %d)\n", | 223 | "higher than exptected. (%llu > %d)\n", |
225 | od->pdev.name, od->pdev.id, | 224 | od->pm_lat_level, deact_lat, |
226 | od->pm_lat_level, deact_lat, | 225 | odpl->deactivate_lat); |
227 | odpl->deactivate_lat); | ||
228 | } | 226 | } |
229 | 227 | ||
230 | |||
231 | od->dev_wakeup_lat += odpl->activate_lat; | 228 | od->dev_wakeup_lat += odpl->activate_lat; |
232 | 229 | ||
233 | od->pm_lat_level++; | 230 | od->pm_lat_level++; |
@@ -245,28 +242,27 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias, | |||
245 | if (!clk_alias || !clk_name) | 242 | if (!clk_alias || !clk_name) |
246 | return; | 243 | return; |
247 | 244 | ||
248 | pr_debug("omap_device: %s: Creating %s -> %s\n", | 245 | dev_dbg(&od->pdev.dev, "Creating %s -> %s\n", clk_alias, clk_name); |
249 | dev_name(&od->pdev.dev), clk_alias, clk_name); | ||
250 | 246 | ||
251 | r = clk_get_sys(dev_name(&od->pdev.dev), clk_alias); | 247 | r = clk_get_sys(dev_name(&od->pdev.dev), clk_alias); |
252 | if (!IS_ERR(r)) { | 248 | if (!IS_ERR(r)) { |
253 | pr_warning("omap_device: %s: alias %s already exists\n", | 249 | dev_warn(&od->pdev.dev, |
254 | dev_name(&od->pdev.dev), clk_alias); | 250 | "alias %s already exists\n", clk_alias); |
255 | clk_put(r); | 251 | clk_put(r); |
256 | return; | 252 | return; |
257 | } | 253 | } |
258 | 254 | ||
259 | r = omap_clk_get_by_name(clk_name); | 255 | r = omap_clk_get_by_name(clk_name); |
260 | if (IS_ERR(r)) { | 256 | if (IS_ERR(r)) { |
261 | pr_err("omap_device: %s: omap_clk_get_by_name for %s failed\n", | 257 | dev_err(&od->pdev.dev, |
262 | dev_name(&od->pdev.dev), clk_name); | 258 | "omap_clk_get_by_name for %s failed\n", clk_name); |
263 | return; | 259 | return; |
264 | } | 260 | } |
265 | 261 | ||
266 | l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev.dev)); | 262 | l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev.dev)); |
267 | if (!l) { | 263 | if (!l) { |
268 | pr_err("omap_device: %s: clkdev_alloc for %s failed\n", | 264 | dev_err(&od->pdev.dev, |
269 | dev_name(&od->pdev.dev), clk_alias); | 265 | "clkdev_alloc for %s failed\n", clk_alias); |
270 | return; | 266 | return; |
271 | } | 267 | } |
272 | 268 | ||
@@ -671,8 +667,9 @@ int omap_device_enable(struct platform_device *pdev) | |||
671 | od = to_omap_device(pdev); | 667 | od = to_omap_device(pdev); |
672 | 668 | ||
673 | if (od->_state == OMAP_DEVICE_STATE_ENABLED) { | 669 | if (od->_state == OMAP_DEVICE_STATE_ENABLED) { |
674 | WARN(1, "omap_device: %s.%d: %s() called from invalid state %d\n", | 670 | dev_warn(&pdev->dev, |
675 | od->pdev.name, od->pdev.id, __func__, od->_state); | 671 | "omap_device: %s() called from invalid state %d\n", |
672 | __func__, od->_state); | ||
676 | return -EINVAL; | 673 | return -EINVAL; |
677 | } | 674 | } |
678 | 675 | ||
@@ -710,8 +707,9 @@ int omap_device_idle(struct platform_device *pdev) | |||
710 | od = to_omap_device(pdev); | 707 | od = to_omap_device(pdev); |
711 | 708 | ||
712 | if (od->_state != OMAP_DEVICE_STATE_ENABLED) { | 709 | if (od->_state != OMAP_DEVICE_STATE_ENABLED) { |
713 | WARN(1, "omap_device: %s.%d: %s() called from invalid state %d\n", | 710 | dev_warn(&pdev->dev, |
714 | od->pdev.name, od->pdev.id, __func__, od->_state); | 711 | "omap_device: %s() called from invalid state %d\n", |
712 | __func__, od->_state); | ||
715 | return -EINVAL; | 713 | return -EINVAL; |
716 | } | 714 | } |
717 | 715 | ||
@@ -742,8 +740,9 @@ int omap_device_shutdown(struct platform_device *pdev) | |||
742 | 740 | ||
743 | if (od->_state != OMAP_DEVICE_STATE_ENABLED && | 741 | if (od->_state != OMAP_DEVICE_STATE_ENABLED && |
744 | od->_state != OMAP_DEVICE_STATE_IDLE) { | 742 | od->_state != OMAP_DEVICE_STATE_IDLE) { |
745 | WARN(1, "omap_device: %s.%d: %s() called from invalid state %d\n", | 743 | dev_warn(&pdev->dev, |
746 | od->pdev.name, od->pdev.id, __func__, od->_state); | 744 | "omap_device: %s() called from invalid state %d\n", |
745 | __func__, od->_state); | ||
747 | return -EINVAL; | 746 | return -EINVAL; |
748 | } | 747 | } |
749 | 748 | ||