aboutsummaryrefslogtreecommitdiffstats
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 @@
8 * 8 *
9 */ 9 */
10 10
11#include <linux/vt_kern.h>
12#include <linux/device.h> 11#include <linux/device.h>
12#include <linux/kallsyms.h>
13#include <linux/pm.h>
13#include "../base.h" 14#include "../base.h"
14#include "power.h" 15#include "power.h"
15 16
@@ -58,11 +59,13 @@ int suspend_device(struct device * dev, pm_message_t state)
58 if (dev->bus && dev->bus->suspend && !dev->power.power_state.event) { 59 if (dev->bus && dev->bus->suspend && !dev->power.power_state.event) {
59 dev_dbg(dev, "suspending\n"); 60 dev_dbg(dev, "suspending\n");
60 error = dev->bus->suspend(dev, state); 61 error = dev->bus->suspend(dev, state);
62 suspend_report_result(dev->bus->suspend, error);
61 } 63 }
62 up(&dev->sem); 64 up(&dev->sem);
63 return error; 65 return error;
64} 66}
65 67
68
66/** 69/**
67 * device_suspend - Save state and stop all devices in system. 70 * device_suspend - Save state and stop all devices in system.
68 * @state: Power state to put each device in. 71 * @state: Power state to put each device in.
@@ -82,9 +85,6 @@ int device_suspend(pm_message_t state)
82{ 85{
83 int error = 0; 86 int error = 0;
84 87
85 if (!is_console_suspend_safe())
86 return -EINVAL;
87
88 down(&dpm_sem); 88 down(&dpm_sem);
89 down(&dpm_list_sem); 89 down(&dpm_list_sem);
90 while (!list_empty(&dpm_active) && error == 0) { 90 while (!list_empty(&dpm_active) && error == 0) {
@@ -169,3 +169,12 @@ int device_power_down(pm_message_t state)
169 169
170EXPORT_SYMBOL_GPL(device_power_down); 170EXPORT_SYMBOL_GPL(device_power_down);
171 171
172void __suspend_report_result(const char *function, void *fn, int ret)
173{
174 if (ret) {
175 printk(KERN_ERR "%s(): ", function);
176 print_fn_descriptor_symbol("%s() returns ", (unsigned long)fn);
177 printk("%d\n", ret);
178 }
179}
180EXPORT_SYMBOL_GPL(__suspend_report_result);