Commit 49882c99 authored by Kevin Hilman's avatar Kevin Hilman

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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
parent 796ba283
...@@ -114,7 +114,7 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat) ...@@ -114,7 +114,7 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
{ {
struct timespec a, b, c; struct timespec a, b, c;
pr_debug("omap_device: %s: activating\n", od->pdev.name); dev_dbg(&od->pdev.dev, "omap_device: activating\n");
while (od->pm_lat_level > 0) { while (od->pm_lat_level > 0) {
struct omap_device_pm_latency *odpl; struct omap_device_pm_latency *odpl;
...@@ -138,23 +138,22 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat) ...@@ -138,23 +138,22 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
c = timespec_sub(b, a); c = timespec_sub(b, a);
act_lat = timespec_to_ns(&c); act_lat = timespec_to_ns(&c);
pr_debug("omap_device: %s: pm_lat %d: activate: elapsed time " dev_dbg(&od->pdev.dev,
"%llu nsec\n", od->pdev.name, od->pm_lat_level, "omap_device: pm_lat %d: activate: elapsed time "
act_lat); "%llu nsec\n", od->pm_lat_level, act_lat);
if (act_lat > odpl->activate_lat) { if (act_lat > odpl->activate_lat) {
odpl->activate_lat_worst = act_lat; odpl->activate_lat_worst = act_lat;
if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
odpl->activate_lat = act_lat; odpl->activate_lat = act_lat;
pr_warning("omap_device: %s.%d: new worst case " dev_warn(&od->pdev.dev,
"activate latency %d: %llu\n", "new worst case activate latency "
od->pdev.name, od->pdev.id, "%d: %llu\n",
od->pm_lat_level, act_lat); od->pm_lat_level, act_lat);
} else } else
pr_warning("omap_device: %s.%d: activate " dev_warn(&od->pdev.dev,
"latency %d higher than exptected. " "activate latency %d "
"(%llu > %d)\n", "higher than exptected. (%llu > %d)\n",
od->pdev.name, od->pdev.id,
od->pm_lat_level, act_lat, od->pm_lat_level, act_lat,
odpl->activate_lat); odpl->activate_lat);
} }
...@@ -183,7 +182,7 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat) ...@@ -183,7 +182,7 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
{ {
struct timespec a, b, c; struct timespec a, b, c;
pr_debug("omap_device: %s: deactivating\n", od->pdev.name); dev_dbg(&od->pdev.dev, "omap_device: deactivating\n");
while (od->pm_lat_level < od->pm_lats_cnt) { while (od->pm_lat_level < od->pm_lats_cnt) {
struct omap_device_pm_latency *odpl; struct omap_device_pm_latency *odpl;
...@@ -206,28 +205,26 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat) ...@@ -206,28 +205,26 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
c = timespec_sub(b, a); c = timespec_sub(b, a);
deact_lat = timespec_to_ns(&c); deact_lat = timespec_to_ns(&c);
pr_debug("omap_device: %s: pm_lat %d: deactivate: elapsed time " dev_dbg(&od->pdev.dev,
"%llu nsec\n", od->pdev.name, od->pm_lat_level, "omap_device: pm_lat %d: deactivate: elapsed time "
deact_lat); "%llu nsec\n", od->pm_lat_level, deact_lat);
if (deact_lat > odpl->deactivate_lat) { if (deact_lat > odpl->deactivate_lat) {
odpl->deactivate_lat_worst = deact_lat; odpl->deactivate_lat_worst = deact_lat;
if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
odpl->deactivate_lat = deact_lat; odpl->deactivate_lat = deact_lat;
pr_warning("omap_device: %s.%d: new worst case " dev_warn(&od->pdev.dev,
"deactivate latency %d: %llu\n", "new worst case deactivate latency "
od->pdev.name, od->pdev.id, "%d: %llu\n",
od->pm_lat_level, deact_lat); od->pm_lat_level, deact_lat);
} else } else
pr_warning("omap_device: %s.%d: deactivate " dev_warn(&od->pdev.dev,
"latency %d higher than exptected. " "deactivate latency %d "
"(%llu > %d)\n", "higher than exptected. (%llu > %d)\n",
od->pdev.name, od->pdev.id,
od->pm_lat_level, deact_lat, od->pm_lat_level, deact_lat,
odpl->deactivate_lat); odpl->deactivate_lat);
} }
od->dev_wakeup_lat += odpl->activate_lat; od->dev_wakeup_lat += odpl->activate_lat;
od->pm_lat_level++; od->pm_lat_level++;
...@@ -245,28 +242,27 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias, ...@@ -245,28 +242,27 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias,
if (!clk_alias || !clk_name) if (!clk_alias || !clk_name)
return; return;
pr_debug("omap_device: %s: Creating %s -> %s\n", dev_dbg(&od->pdev.dev, "Creating %s -> %s\n", clk_alias, clk_name);
dev_name(&od->pdev.dev), clk_alias, clk_name);
r = clk_get_sys(dev_name(&od->pdev.dev), clk_alias); r = clk_get_sys(dev_name(&od->pdev.dev), clk_alias);
if (!IS_ERR(r)) { if (!IS_ERR(r)) {
pr_warning("omap_device: %s: alias %s already exists\n", dev_warn(&od->pdev.dev,
dev_name(&od->pdev.dev), clk_alias); "alias %s already exists\n", clk_alias);
clk_put(r); clk_put(r);
return; return;
} }
r = omap_clk_get_by_name(clk_name); r = omap_clk_get_by_name(clk_name);
if (IS_ERR(r)) { if (IS_ERR(r)) {
pr_err("omap_device: %s: omap_clk_get_by_name for %s failed\n", dev_err(&od->pdev.dev,
dev_name(&od->pdev.dev), clk_name); "omap_clk_get_by_name for %s failed\n", clk_name);
return; return;
} }
l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev.dev)); l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev.dev));
if (!l) { if (!l) {
pr_err("omap_device: %s: clkdev_alloc for %s failed\n", dev_err(&od->pdev.dev,
dev_name(&od->pdev.dev), clk_alias); "clkdev_alloc for %s failed\n", clk_alias);
return; return;
} }
...@@ -671,8 +667,9 @@ int omap_device_enable(struct platform_device *pdev) ...@@ -671,8 +667,9 @@ int omap_device_enable(struct platform_device *pdev)
od = to_omap_device(pdev); od = to_omap_device(pdev);
if (od->_state == OMAP_DEVICE_STATE_ENABLED) { if (od->_state == OMAP_DEVICE_STATE_ENABLED) {
WARN(1, "omap_device: %s.%d: %s() called from invalid state %d\n", dev_warn(&pdev->dev,
od->pdev.name, od->pdev.id, __func__, od->_state); "omap_device: %s() called from invalid state %d\n",
__func__, od->_state);
return -EINVAL; return -EINVAL;
} }
...@@ -710,8 +707,9 @@ int omap_device_idle(struct platform_device *pdev) ...@@ -710,8 +707,9 @@ int omap_device_idle(struct platform_device *pdev)
od = to_omap_device(pdev); od = to_omap_device(pdev);
if (od->_state != OMAP_DEVICE_STATE_ENABLED) { if (od->_state != OMAP_DEVICE_STATE_ENABLED) {
WARN(1, "omap_device: %s.%d: %s() called from invalid state %d\n", dev_warn(&pdev->dev,
od->pdev.name, od->pdev.id, __func__, od->_state); "omap_device: %s() called from invalid state %d\n",
__func__, od->_state);
return -EINVAL; return -EINVAL;
} }
...@@ -742,8 +740,9 @@ int omap_device_shutdown(struct platform_device *pdev) ...@@ -742,8 +740,9 @@ int omap_device_shutdown(struct platform_device *pdev)
if (od->_state != OMAP_DEVICE_STATE_ENABLED && if (od->_state != OMAP_DEVICE_STATE_ENABLED &&
od->_state != OMAP_DEVICE_STATE_IDLE) { od->_state != OMAP_DEVICE_STATE_IDLE) {
WARN(1, "omap_device: %s.%d: %s() called from invalid state %d\n", dev_warn(&pdev->dev,
od->pdev.name, od->pdev.id, __func__, od->_state); "omap_device: %s() called from invalid state %d\n",
__func__, od->_state);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment