* [PATCH] OMAP: omap_device: replace pr_* prints with dev_*
@ 2011-07-21 17:39 Kevin Hilman
2011-07-21 17:43 ` Felipe Balbi
2011-07-22 13:15 ` Grazvydas Ignotas
0 siblings, 2 replies; 5+ messages in thread
From: Kevin Hilman @ 2011-07-21 17:39 UTC (permalink / raw)
To: linux-arm-kernel
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>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
Unless there are objections, I'll queue this as a fix for the v3.1-rc cycle.
arch/arm/plat-omap/omap_device.c | 70 ++++++++++++++++++--------------------
1 files changed, 33 insertions(+), 37 deletions(-)
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index be45147..1914d7e 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)
{
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) {
struct omap_device_pm_latency *odpl;
@@ -138,25 +138,24 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
c = timespec_sub(b, a);
act_lat = timespec_to_ns(&c);
- pr_debug("omap_device: %s: pm_lat %d: activate: elapsed time "
- "%llu nsec\n", od->pdev.name, od->pm_lat_level,
- act_lat);
+ dev_dbg(&od->pdev.dev,
+ "omap_device: pm_lat %d: activate: elapsed time "
+ "%llu nsec\n", od->pm_lat_level, act_lat);
if (act_lat > odpl->activate_lat) {
odpl->activate_lat_worst = act_lat;
if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
odpl->activate_lat = act_lat;
- pr_warning("omap_device: %s.%d: new worst case "
- "activate latency %d: %llu\n",
- od->pdev.name, od->pdev.id,
- od->pm_lat_level, act_lat);
+ dev_warn(&od->pdev.dev,
+ "new worst case activate latency "
+ "%d: %llu\n",
+ od->pm_lat_level, act_lat);
} else
- pr_warning("omap_device: %s.%d: activate "
- "latency %d higher than exptected. "
- "(%llu > %d)\n",
- od->pdev.name, od->pdev.id,
- od->pm_lat_level, act_lat,
- odpl->activate_lat);
+ dev_warn(&od->pdev.dev,
+ "activate latency %d "
+ "higher than exptected. (%llu > %d)\n",
+ od->pm_lat_level, act_lat,
+ odpl->activate_lat);
}
od->dev_wakeup_lat -= odpl->activate_lat;
@@ -183,7 +182,7 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
{
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) {
struct omap_device_pm_latency *odpl;
@@ -206,28 +205,26 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
c = timespec_sub(b, a);
deact_lat = timespec_to_ns(&c);
- pr_debug("omap_device: %s: pm_lat %d: deactivate: elapsed time "
- "%llu nsec\n", od->pdev.name, od->pm_lat_level,
- deact_lat);
+ dev_dbg(&od->pdev.dev,
+ "omap_device: pm_lat %d: deactivate: elapsed time "
+ "%llu nsec\n", od->pm_lat_level, deact_lat);
if (deact_lat > odpl->deactivate_lat) {
odpl->deactivate_lat_worst = deact_lat;
if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
odpl->deactivate_lat = deact_lat;
- pr_warning("omap_device: %s.%d: new worst case "
- "deactivate latency %d: %llu\n",
- od->pdev.name, od->pdev.id,
- od->pm_lat_level, deact_lat);
+ dev_warn(&od->pdev.dev,
+ "new worst case deactivate latency "
+ "%d: %llu\n",
+ od->pm_lat_level, deact_lat);
} else
- pr_warning("omap_device: %s.%d: deactivate "
- "latency %d higher than exptected. "
- "(%llu > %d)\n",
- od->pdev.name, od->pdev.id,
- od->pm_lat_level, deact_lat,
- odpl->deactivate_lat);
+ dev_warn(&od->pdev.dev,
+ "deactivate latency %d "
+ "higher than exptected. (%llu > %d)\n",
+ od->pm_lat_level, deact_lat,
+ odpl->deactivate_lat);
}
-
od->dev_wakeup_lat += odpl->activate_lat;
od->pm_lat_level++;
@@ -245,28 +242,27 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias,
if (!clk_alias || !clk_name)
return;
- pr_debug("omap_device: %s: Creating %s -> %s\n",
- dev_name(&od->pdev.dev), clk_alias, clk_name);
+ dev_dbg(&od->pdev.dev, "Creating %s -> %s\n", clk_alias, clk_name);
r = clk_get_sys(dev_name(&od->pdev.dev), clk_alias);
if (!IS_ERR(r)) {
- pr_warning("omap_device: %s: alias %s already exists\n",
- dev_name(&od->pdev.dev), clk_alias);
+ dev_warn(&od->pdev.dev,
+ "alias %s already exists\n", clk_alias);
clk_put(r);
return;
}
r = omap_clk_get_by_name(clk_name);
if (IS_ERR(r)) {
- pr_err("omap_device: %s: omap_clk_get_by_name for %s failed\n",
- dev_name(&od->pdev.dev), clk_name);
+ dev_err(&od->pdev.dev,
+ "omap_clk_get_by_name for %s failed\n", clk_name);
return;
}
l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev.dev));
if (!l) {
- pr_err("omap_device: %s: clkdev_alloc for %s failed\n",
- dev_name(&od->pdev.dev), clk_alias);
+ dev_err(&od->pdev.dev,
+ "clkdev_alloc for %s failed\n", clk_alias);
return;
}
--
1.7.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] OMAP: omap_device: replace pr_* prints with dev_*
2011-07-21 17:39 [PATCH] OMAP: omap_device: replace pr_* prints with dev_* Kevin Hilman
@ 2011-07-21 17:43 ` Felipe Balbi
2011-07-21 18:52 ` Kevin Hilman
2011-07-22 13:15 ` Grazvydas Ignotas
1 sibling, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2011-07-21 17:43 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jul 21, 2011 at 10:39:36AM -0700, Kevin Hilman wrote:
> 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>
> Cc: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Kevin Hilman <khilman@ti.com>
> ---
FWIW:
Reviewed-by: Felipe Balbi <balbi@ti.com>
BTW, I tried applying this to today's linus/master, but it fails
(rejects below), are you depending on some other changes ?
--- arch/arm/plat-omap/omap_device.c
+++ arch/arm/plat-omap/omap_device.c
@@ -242,28 +239,27 @@
if (!clk_alias || !clk_name)
return;
- pr_debug("omap_device: %s: Creating %s -> %s\n",
- dev_name(&od->pdev.dev), clk_alias, clk_name);
+ dev_dbg(&od->pdev.dev, "Creating %s -> %s\n", clk_alias, clk_name);
r = clk_get_sys(dev_name(&od->pdev.dev), clk_alias);
if (!IS_ERR(r)) {
- pr_warning("omap_device: %s: alias %s already exists\n",
- dev_name(&od->pdev.dev), clk_alias);
+ dev_warn(&od->pdev.dev,
+ "alias %s already exists\n", clk_alias);
clk_put(r);
return;
}
r = omap_clk_get_by_name(clk_name);
if (IS_ERR(r)) {
- pr_err("omap_device: %s: omap_clk_get_by_name for %s failed\n",
- dev_name(&od->pdev.dev), clk_name);
+ dev_err(&od->pdev.dev,
+ "omap_clk_get_by_name for %s failed\n", clk_name);
return;
}
l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev.dev));
if (!l) {
- pr_err("omap_device: %s: clkdev_alloc for %s failed\n",
- dev_name(&od->pdev.dev), clk_alias);
+ dev_err(&od->pdev.dev,
+ "clkdev_alloc for %s failed\n", clk_alias);
return;
}
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110721/ac50781d/attachment-0001.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] OMAP: omap_device: replace pr_* prints with dev_*
2011-07-21 17:43 ` Felipe Balbi
@ 2011-07-21 18:52 ` Kevin Hilman
0 siblings, 0 replies; 5+ messages in thread
From: Kevin Hilman @ 2011-07-21 18:52 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, 2011-07-21 at 20:43 +0300, Felipe Balbi wrote:
> On Thu, Jul 21, 2011 at 10:39:36AM -0700, Kevin Hilman wrote:
> > 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>
> > Cc: Felipe Balbi <balbi@ti.com>
> > Signed-off-by: Kevin Hilman <khilman@ti.com>
> > ---
>
> FWIW:
>
> Reviewed-by: Felipe Balbi <balbi@ti.com>
Thanks.
> BTW, I tried applying this to today's linus/master, but it fails
> (rejects below), are you depending on some other changes ?
Oops, I forgot to mention it applies on top of a bunch of stuff queued
for v3.1. Specifically, it's on top of Paul's prcm-devel-3.1 branch[1],
which Arnd has merged into the arm-soc tree.
Kevin
[1] git://git.pwsan.com/linux-2.6 prcm-devel-3.1
> --- arch/arm/plat-omap/omap_device.c
> +++ arch/arm/plat-omap/omap_device.c
> @@ -242,28 +239,27 @@
> if (!clk_alias || !clk_name)
> return;
>
> - pr_debug("omap_device: %s: Creating %s -> %s\n",
> - dev_name(&od->pdev.dev), clk_alias, clk_name);
> + dev_dbg(&od->pdev.dev, "Creating %s -> %s\n", clk_alias, clk_name);
>
> r = clk_get_sys(dev_name(&od->pdev.dev), clk_alias);
> if (!IS_ERR(r)) {
> - pr_warning("omap_device: %s: alias %s already exists\n",
> - dev_name(&od->pdev.dev), clk_alias);
> + dev_warn(&od->pdev.dev,
> + "alias %s already exists\n", clk_alias);
> clk_put(r);
> return;
> }
>
> r = omap_clk_get_by_name(clk_name);
> if (IS_ERR(r)) {
> - pr_err("omap_device: %s: omap_clk_get_by_name for %s failed\n",
> - dev_name(&od->pdev.dev), clk_name);
> + dev_err(&od->pdev.dev,
> + "omap_clk_get_by_name for %s failed\n", clk_name);
> return;
> }
>
> l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev.dev));
> if (!l) {
> - pr_err("omap_device: %s: clkdev_alloc for %s failed\n",
> - dev_name(&od->pdev.dev), clk_alias);
> + dev_err(&od->pdev.dev,
> + "clkdev_alloc for %s failed\n", clk_alias);
> return;
> }
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] OMAP: omap_device: replace pr_* prints with dev_*
2011-07-21 17:39 [PATCH] OMAP: omap_device: replace pr_* prints with dev_* Kevin Hilman
2011-07-21 17:43 ` Felipe Balbi
@ 2011-07-22 13:15 ` Grazvydas Ignotas
2011-07-22 19:51 ` Kevin Hilman
1 sibling, 1 reply; 5+ messages in thread
From: Grazvydas Ignotas @ 2011-07-22 13:15 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jul 21, 2011 at 8:39 PM, Kevin Hilman <khilman@ti.com> wrote:
> ? ? ? ? ? ? ? ?if (act_lat > odpl->activate_lat) {
> ? ? ? ? ? ? ? ? ? ? ? ?odpl->activate_lat_worst = act_lat;
> ? ? ? ? ? ? ? ? ? ? ? ?if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?odpl->activate_lat = act_lat;
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pr_warning("omap_device: %s.%d: new worst case "
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"activate latency %d: %llu\n",
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?od->pdev.name, od->pdev.id,
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?od->pm_lat_level, act_lat);
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dev_warn(&od->pdev.dev,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"new worst case activate latency "
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"%d: %llu\n",
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?od->pm_lat_level, act_lat);
I wonder why these have to be warnings, I get quite a lot of them and
find them rather annoying. Or is my hardware broken or something?
I know other people are disabling this in their trees too:
http://www.sakoman.com/cgi-bin/gitweb.cgi?p=linux-omap-2.6.git;a=commitdiff;h=145cf9a7d4ba7c260df7071a28ef40c6a481b6df
--
Gra?vydas
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] OMAP: omap_device: replace pr_* prints with dev_*
2011-07-22 13:15 ` Grazvydas Ignotas
@ 2011-07-22 19:51 ` Kevin Hilman
0 siblings, 0 replies; 5+ messages in thread
From: Kevin Hilman @ 2011-07-22 19:51 UTC (permalink / raw)
To: linux-arm-kernel
Grazvydas Ignotas <notasas@gmail.com> writes:
> On Thu, Jul 21, 2011 at 8:39 PM, Kevin Hilman <khilman@ti.com> wrote:
>> ? ? ? ? ? ? ? ?if (act_lat > odpl->activate_lat) {
>> ? ? ? ? ? ? ? ? ? ? ? ?odpl->activate_lat_worst = act_lat;
>> ? ? ? ? ? ? ? ? ? ? ? ?if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?odpl->activate_lat = act_lat;
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pr_warning("omap_device: %s.%d: new worst case "
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"activate latency %d: %llu\n",
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?od->pdev.name, od->pdev.id,
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?od->pm_lat_level, act_lat);
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dev_warn(&od->pdev.dev,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"new worst case activate latency "
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"%d: %llu\n",
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?od->pm_lat_level, act_lat);
>
> I wonder why these have to be warnings, I get quite a lot of them and
> find them rather annoying. Or is my hardware broken or something?
No, your hardware is not broken.
> I know other people are disabling this in their trees too:
> http://www.sakoman.com/cgi-bin/gitweb.cgi?p=linux-omap-2.6.git;a=commitdiff;h=145cf9a7d4ba7c260df7071a28ef40c6a481b6df
Patches to change that are welcome on the list.
It's not related to this patch which just changes from pr_warning to
dev_warn, so needs to be done in a separate patch.
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-07-22 19:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-21 17:39 [PATCH] OMAP: omap_device: replace pr_* prints with dev_* Kevin Hilman
2011-07-21 17:43 ` Felipe Balbi
2011-07-21 18:52 ` Kevin Hilman
2011-07-22 13:15 ` Grazvydas Ignotas
2011-07-22 19:51 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox