aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power/resume.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/power/resume.c')
-rw-r--r--drivers/base/power/resume.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/base/power/resume.c b/drivers/base/power/resume.c
index 26468971ef5a..bdd96b03b885 100644
--- a/drivers/base/power/resume.c
+++ b/drivers/base/power/resume.c
@@ -22,6 +22,9 @@ extern int sysdev_resume(void);
22 22
23int resume_device(struct device * dev) 23int resume_device(struct device * dev)
24{ 24{
25 int error = 0;
26
27 down(&dev->sem);
25 if (dev->power.pm_parent 28 if (dev->power.pm_parent
26 && dev->power.pm_parent->power.power_state) { 29 && dev->power.pm_parent->power.power_state) {
27 dev_err(dev, "PM: resume from %d, parent %s still %d\n", 30 dev_err(dev, "PM: resume from %d, parent %s still %d\n",
@@ -31,9 +34,10 @@ int resume_device(struct device * dev)
31 } 34 }
32 if (dev->bus && dev->bus->resume) { 35 if (dev->bus && dev->bus->resume) {
33 dev_dbg(dev,"resuming\n"); 36 dev_dbg(dev,"resuming\n");
34 return dev->bus->resume(dev); 37 error = dev->bus->resume(dev);
35 } 38 }
36 return 0; 39 up(&dev->sem);
40 return error;
37} 41}
38 42
39 43