diff options
Diffstat (limited to 'drivers/base/power/resume.c')
-rw-r--r-- | drivers/base/power/resume.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/base/power/resume.c b/drivers/base/power/resume.c index 020be36705a6..a2c64188d713 100644 --- a/drivers/base/power/resume.c +++ b/drivers/base/power/resume.c | |||
@@ -26,7 +26,9 @@ int resume_device(struct device * dev) | |||
26 | 26 | ||
27 | TRACE_DEVICE(dev); | 27 | TRACE_DEVICE(dev); |
28 | TRACE_RESUME(0); | 28 | TRACE_RESUME(0); |
29 | |||
29 | down(&dev->sem); | 30 | down(&dev->sem); |
31 | |||
30 | if (dev->power.pm_parent | 32 | if (dev->power.pm_parent |
31 | && dev->power.pm_parent->power.power_state.event) { | 33 | && dev->power.pm_parent->power.power_state.event) { |
32 | dev_err(dev, "PM: resume from %d, parent %s still %d\n", | 34 | dev_err(dev, "PM: resume from %d, parent %s still %d\n", |
@@ -34,15 +36,24 @@ int resume_device(struct device * dev) | |||
34 | dev->power.pm_parent->bus_id, | 36 | dev->power.pm_parent->bus_id, |
35 | dev->power.pm_parent->power.power_state.event); | 37 | dev->power.pm_parent->power.power_state.event); |
36 | } | 38 | } |
39 | |||
37 | if (dev->bus && dev->bus->resume) { | 40 | if (dev->bus && dev->bus->resume) { |
38 | dev_dbg(dev,"resuming\n"); | 41 | dev_dbg(dev,"resuming\n"); |
39 | error = dev->bus->resume(dev); | 42 | error = dev->bus->resume(dev); |
40 | } | 43 | } |
41 | if (dev->class && dev->class->resume) { | 44 | |
45 | if (!error && dev->type && dev->type->resume) { | ||
46 | dev_dbg(dev,"resuming\n"); | ||
47 | error = dev->type->resume(dev); | ||
48 | } | ||
49 | |||
50 | if (!error && dev->class && dev->class->resume) { | ||
42 | dev_dbg(dev,"class resume\n"); | 51 | dev_dbg(dev,"class resume\n"); |
43 | error = dev->class->resume(dev); | 52 | error = dev->class->resume(dev); |
44 | } | 53 | } |
54 | |||
45 | up(&dev->sem); | 55 | up(&dev->sem); |
56 | |||
46 | TRACE_RESUME(error); | 57 | TRACE_RESUME(error); |
47 | return error; | 58 | return error; |
48 | } | 59 | } |