ChangeSet 1.2207, 2005/03/30 09:43:40-08:00, [EMAIL PROTECTED]

        [PATCH] more pm_message_t fixes
        
        While fixing usb, I stomped on a few more fixes. Print error when some
        device fails to power down, and 2 is no longer valid state to pass in
        pm_message_t.
        
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 base/power/suspend.c |    2 ++
 ide/ide-disk.c       |    2 +-
 pci/pci.c            |   12 +++++++-----
 3 files changed, 10 insertions(+), 6 deletions(-)


diff -Nru a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c
--- a/drivers/base/power/suspend.c      2005-03-30 12:12:27 -08:00
+++ b/drivers/base/power/suspend.c      2005-03-30 12:12:27 -08:00
@@ -134,6 +134,8 @@
  Done:
        return error;
  Error:
+       printk(KERN_ERR "Could not power down device %s: "
+               "error %d\n", kobject_name(&dev->kobj), error);
        dpm_power_up();
        goto Done;
 }
diff -Nru a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
--- a/drivers/ide/ide-disk.c    2005-03-30 12:12:27 -08:00
+++ b/drivers/ide/ide-disk.c    2005-03-30 12:12:27 -08:00
@@ -1076,7 +1076,7 @@
        }
 
        printk("Shutdown: %s\n", drive->name);
-       dev->bus->suspend(dev, PM_SUSPEND_STANDBY);
+       dev->bus->suspend(dev, PMSG_SUSPEND);
 }
 
 /*
diff -Nru a/drivers/pci/pci.c b/drivers/pci/pci.c
--- a/drivers/pci/pci.c 2005-03-30 12:12:27 -08:00
+++ b/drivers/pci/pci.c 2005-03-30 12:12:27 -08:00
@@ -312,22 +312,24 @@
 /**
  * pci_choose_state - Choose the power state of a PCI device
  * @dev: PCI device to be suspended
- * @state: target sleep state for the whole system
+ * @state: target sleep state for the whole system. This is the value
+ *     that is passed to suspend() function.
  *
  * Returns PCI power state suitable for given device and given system
  * message.
  */
 
-pci_power_t pci_choose_state(struct pci_dev *dev, u32 state)
+pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state)
 {
        if (!pci_find_capability(dev, PCI_CAP_ID_PM))
                return PCI_D0;
 
        switch (state) {
-       case 0: return PCI_D0;
-       case 2: return PCI_D2;
+       case 0: return PCI_D0;
        case 3: return PCI_D3hot;
-       default: BUG();
+       default:
+               printk("They asked me for state %d\n", state);
+               BUG();
        }
        return PCI_D0;
 }
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to