summaryrefslogtreecommitdiffstats
path: root/drivers/base/power/suspend.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/power/suspend.c')
-rw-r--r--drivers/base/power/suspend.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c
index bdb60663f2ef..2a769cc6f5f9 100644
--- a/drivers/base/power/suspend.c
+++ b/drivers/base/power/suspend.c
@@ -8,8 +8,9 @@
*
*/
-#include <linux/vt_kern.h>
#include <linux/device.h>
+#include <linux/kallsyms.h>
+#include <linux/pm.h>
#include "../base.h"
#include "power.h"
@@ -58,11 +59,13 @@ int suspend_device(struct device * dev, pm_message_t state)
if (dev->bus && dev->bus->suspend && !dev->power.power_state.event) {
dev_dbg(dev, "suspending\n");
error = dev->bus->suspend(dev, state);
+ suspend_report_result(dev->bus->suspend, error);
}
up(&dev->sem);
return error;
}
+
/**
* device_suspend - Save state and stop all devices in system.
* @state: Power state to put each device in.
@@ -82,9 +85,6 @@ int device_suspend(pm_message_t state)
{
int error = 0;
- if (!is_console_suspend_safe())
- return -EINVAL;
-
down(&dpm_sem);
down(&dpm_list_sem);
while (!list_empty(&dpm_active) && error == 0) {
@@ -169,3 +169,12 @@ int device_power_down(pm_message_t state)
EXPORT_SYMBOL_GPL(device_power_down);
+void __suspend_report_result(const char *function, void *fn, int ret)
+{
+ if (ret) {
+ printk(KERN_ERR "%s(): ", function);
+ print_fn_descriptor_symbol("%s() returns ", (unsigned long)fn);
+ printk("%d\n", ret);
+ }
+}
+EXPORT_SYMBOL_GPL(__suspend_report_result);