diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2009-12-13 14:31:12 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2009-12-15 14:42:06 -0500 |
commit | 33c3374031facf7599c30a1548dfa4c83da87da3 (patch) | |
tree | a13c07cf40f4a6d26236c4ec97420f4854f91fca /drivers/base/power | |
parent | f2511774863487e61b56a97da07ebf8dd61d7836 (diff) |
PM: Remove unnecessary goto from device_resume_noirq()
In device_resume_noirq() there is the 'End' label and the associated
goto statement that aren't strictly necessary, so rework the code to
get rid of them. Also modify device_suspend_noirq() so that it looks
completely analogous to device_resume_noirq().
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/base/power')
-rw-r--r-- | drivers/base/power/main.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 30f0ceebd36c..df04cb4a3611 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -372,14 +372,11 @@ static int device_resume_noirq(struct device *dev, pm_message_t state) | |||
372 | TRACE_DEVICE(dev); | 372 | TRACE_DEVICE(dev); |
373 | TRACE_RESUME(0); | 373 | TRACE_RESUME(0); |
374 | 374 | ||
375 | if (!dev->bus) | 375 | if (dev->bus && dev->bus->pm) { |
376 | goto End; | ||
377 | |||
378 | if (dev->bus->pm) { | ||
379 | pm_dev_dbg(dev, state, "EARLY "); | 376 | pm_dev_dbg(dev, state, "EARLY "); |
380 | error = pm_noirq_op(dev, dev->bus->pm, state); | 377 | error = pm_noirq_op(dev, dev->bus->pm, state); |
381 | } | 378 | } |
382 | End: | 379 | |
383 | TRACE_RESUME(error); | 380 | TRACE_RESUME(error); |
384 | return error; | 381 | return error; |
385 | } | 382 | } |
@@ -615,10 +612,7 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state) | |||
615 | { | 612 | { |
616 | int error = 0; | 613 | int error = 0; |
617 | 614 | ||
618 | if (!dev->bus) | 615 | if (dev->bus && dev->bus->pm) { |
619 | return 0; | ||
620 | |||
621 | if (dev->bus->pm) { | ||
622 | pm_dev_dbg(dev, state, "LATE "); | 616 | pm_dev_dbg(dev, state, "LATE "); |
623 | error = pm_noirq_op(dev, dev->bus->pm, state); | 617 | error = pm_noirq_op(dev, dev->bus->pm, state); |
624 | } | 618 | } |