Merge branch 'linus' into core/printk
[sfrench/cifs-2.6.git] / drivers / scsi / mesh.c
index 651d09b08f2a22eb6283da21830736271d1d4cd8..11aa917629acda4924a7db48e2f7e5bd5254347f 100644 (file)
@@ -1759,12 +1759,13 @@ static int mesh_suspend(struct macio_dev *mdev, pm_message_t mesg)
 
        switch (mesg.event) {
        case PM_EVENT_SUSPEND:
+       case PM_EVENT_HIBERNATE:
        case PM_EVENT_FREEZE:
                break;
        default:
                return 0;
        }
-       if (mesg.event == mdev->ofdev.dev.power.power_state.event)
+       if (ms->phase == sleeping)
                return 0;
 
        scsi_block_requests(ms->host);
@@ -1779,8 +1780,6 @@ static int mesh_suspend(struct macio_dev *mdev, pm_message_t mesg)
        disable_irq(ms->meshintr);
        set_mesh_power(ms, 0);
 
-       mdev->ofdev.dev.power.power_state = mesg;
-
        return 0;
 }
 
@@ -1789,7 +1788,7 @@ static int mesh_resume(struct macio_dev *mdev)
        struct mesh_state *ms = (struct mesh_state *)macio_get_drvdata(mdev);
        unsigned long flags;
 
-       if (mdev->ofdev.dev.power.power_state.event == PM_EVENT_ON)
+       if (ms->phase != sleeping)
                return 0;
 
        set_mesh_power(ms, 1);
@@ -1800,8 +1799,6 @@ static int mesh_resume(struct macio_dev *mdev)
        enable_irq(ms->meshintr);
        scsi_unblock_requests(ms->host);
 
-       mdev->ofdev.dev.power.power_state.event = PM_EVENT_ON;
-
        return 0;
 }