summaryrefslogtreecommitdiff
path: root/drivers/base/power/shutdown.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2005-05-09 08:07:00 -0700
committerGreg KH <gregkh@suse.de>2005-05-17 14:54:54 -0700
commit82428b62aa6294ea640c7e920a9224ecaf46db65 (patch)
treef9e9bfd1f86f739ee16968378057060417f52bb4 /drivers/base/power/shutdown.c
parentff0d2f90fdc4b564d47a7c26b16de81a16cfa28e (diff)
downloadlwn-82428b62aa6294ea640c7e920a9224ecaf46db65.tar.gz
lwn-82428b62aa6294ea640c7e920a9224ecaf46db65.zip
[PATCH] Driver Core: pm diagnostics update, check for errors
This patch includes various tweaks in the messaging that appears during system pm state transitions: * Warn about certain illegal calls in the device tree, like resuming child before parent or suspending parent before child. This could happen easily enough through sysfs, or in some cases when drivers use device_pm_set_parent(). * Be more consistent about dev_dbg() tracing ... do it for resume() and shutdown() too, and never if the driver doesn't have that method. * Say which type of system sleep state is being entered. Except for the warnings, these only affect debug messaging. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/power/shutdown.c')
-rw-r--r--drivers/base/power/shutdown.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c
index d1e023fbe169..97979901c149 100644
--- a/drivers/base/power/shutdown.c
+++ b/drivers/base/power/shutdown.c
@@ -25,8 +25,10 @@ int device_detach_shutdown(struct device * dev)
return 0;
if (dev->detach_state == DEVICE_PM_OFF) {
- if (dev->driver && dev->driver->shutdown)
+ if (dev->driver && dev->driver->shutdown) {
+ dev_dbg(dev, "shutdown\n");
dev->driver->shutdown(dev);
+ }
return 0;
}
return dpm_runtime_suspend(dev, dev->detach_state);
@@ -52,13 +54,12 @@ void device_shutdown(void)
struct device * dev;
down_write(&devices_subsys.rwsem);
- list_for_each_entry_reverse(dev, &devices_subsys.kset.list, kobj.entry) {
- pr_debug("shutting down %s: ", dev->bus_id);
+ list_for_each_entry_reverse(dev, &devices_subsys.kset.list,
+ kobj.entry) {
if (dev->driver && dev->driver->shutdown) {
- pr_debug("Ok\n");
+ dev_dbg(dev, "shutdown\n");
dev->driver->shutdown(dev);
- } else
- pr_debug("Ignored.\n");
+ }
}
up_write(&devices_subsys.rwsem);