]> err.no Git - linux-2.6/blobdiff - drivers/pci/pci.c
Make sure that userspace does not retrieve stale asynchronous or
[linux-2.6] / drivers / pci / pci.c
index bdfca32b44a1dab16cdf8130cbeaa3bf6859a7e9..c62d2f04339714cbf5380aa68dbdddf4aaba46c0 100644 (file)
@@ -333,13 +333,17 @@ pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state)
        if (platform_pci_choose_state) {
                ret = platform_pci_choose_state(dev, state);
                if (ret >= 0)
-                       state = ret;
+                       state.event = ret;
        }
-       switch (state) {
-       case 0: return PCI_D0;
-       case 3: return PCI_D3hot;
+
+       switch (state.event) {
+       case PM_EVENT_ON:
+               return PCI_D0;
+       case PM_EVENT_FREEZE:
+       case PM_EVENT_SUSPEND:
+               return PCI_D3hot;
        default:
-               printk("They asked me for state %d\n", state);
+               printk("They asked me for state %d\n", state.event);
                BUG();
        }
        return PCI_D0;
@@ -350,10 +354,6 @@ EXPORT_SYMBOL(pci_choose_state);
 /**
  * pci_save_state - save the PCI configuration space of a device before suspending
  * @dev: - PCI device that we're dealing with
- * @buffer: - buffer to hold config space context
- *
- * @buffer must be large enough to hold the entire PCI 2.2 config space 
- * (>= 64 bytes).
  */
 int
 pci_save_state(struct pci_dev *dev)
@@ -368,8 +368,6 @@ pci_save_state(struct pci_dev *dev)
 /** 
  * pci_restore_state - Restore the saved state of a PCI device
  * @dev: - PCI device that we're dealing with
- * @buffer: - saved PCI config space
- *
  */
 int 
 pci_restore_state(struct pci_dev *dev)