PM: Remove unnecessary goto from device_resume_noirq()
authorRafael J. Wysocki <rjw@sisk.pl>
Sun, 13 Dec 2009 19:31:12 +0000 (20:31 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Tue, 15 Dec 2009 19:42:06 +0000 (20:42 +0100)
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>
drivers/base/power/main.c

index 30f0ceebd36c3ec32b4e48022dca9ec2fddb76aa..df04cb4a3611b936c6da7a7f4d5b6ebf52a4f483 100644 (file)
@@ -372,14 +372,11 @@ static int device_resume_noirq(struct device *dev, pm_message_t state)
        TRACE_DEVICE(dev);
        TRACE_RESUME(0);
 
-       if (!dev->bus)
-               goto End;
-
-       if (dev->bus->pm) {
+       if (dev->bus && dev->bus->pm) {
                pm_dev_dbg(dev, state, "EARLY ");
                error = pm_noirq_op(dev, dev->bus->pm, state);
        }
- End:
+
        TRACE_RESUME(error);
        return error;
 }
@@ -615,10 +612,7 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state)
 {
        int error = 0;
 
-       if (!dev->bus)
-               return 0;
-
-       if (dev->bus->pm) {
+       if (dev->bus && dev->bus->pm) {
                pm_dev_dbg(dev, state, "LATE ");
                error = pm_noirq_op(dev, dev->bus->pm, state);
        }