[PATCH] debug: use dev_WARN() rather than WARN_ON() in device_pm_add()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Arjan van de Ven
Date: Friday, September 19, 2008 - 9:08 pm

From: Arjan van de Ven <arjan@linux.intel.com>
Date: Fri, 19 Sep 2008 21:05:25 -0700
Subject: [PATCH] debug: use dev_WARN() rather than WARN_ON() in device_pm_add()

device_pm_add() has a WARN_ON that is showing up relatively high on
kerneloops.org, but unfortunately the WARN_ON is less than useful
in that it doesn't print any information about what device is causing
the issue.

This patch fixes this by turning the WARN_ON() into the newly
introduces dev_WARN() which will print information about the
device in question.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
 drivers/base/power/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index bf6d355..b65667f 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -83,7 +83,7 @@ void device_pm_add(struct device *dev)
 		 * transition is in progress in order to avoid leaving them
 		 * unhandled down the road
 		 */
-		WARN_ON(true);
+		dev_WARN(dev, "Parentless device registered during a PM transaction\n");
 	}
 
 	list_add_tail(&dev->power.entry, &dpm_list);
-- 
1.5.5.1



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] debug: Introduce a dev_WARN() function, Arjan van de Ven, (Fri Sep 19, 9:07 pm)
[PATCH] debug: use dev_WARN() rather than WARN_ON() in dev ..., Arjan van de Ven, (Fri Sep 19, 9:08 pm)
Re: [PATCH] debug: Introduce a dev_WARN() function, Arjan van de Ven, (Fri Sep 19, 11:13 pm)
Re: [PATCH] debug: Introduce a dev_WARN() function, Arjan van de Ven, (Sat Sep 20, 11:11 am)
Re: [PATCH] debug: Introduce a dev_WARN() function, Randy Dunlap, (Sat Sep 20, 3:41 pm)