PCI: pciehp: remove slot_bus field
[safe/jmp/linux-2.6] / drivers / pci / pci-driver.c
index dbfc93c..e5d47be 100644 (file)
@@ -445,8 +445,6 @@ static int pci_legacy_suspend(struct device *dev, pm_message_t state)
        struct pci_dev * pci_dev = to_pci_dev(dev);
        struct pci_driver * drv = pci_dev->driver;
 
-       pci_dev->state_saved = false;
-
        if (drv && drv->suspend) {
                pci_power_t prev = pci_dev->current_state;
                int error;
@@ -542,7 +540,6 @@ static int pci_restore_standard_config(struct pci_dev *pci_dev)
 static void pci_pm_default_resume_noirq(struct pci_dev *pci_dev)
 {
        pci_restore_standard_config(pci_dev);
-       pci_dev->state_saved = false;
        pci_fixup_device(pci_fixup_resume_early, pci_dev);
 }
 
@@ -603,13 +600,11 @@ static void pci_pm_complete(struct device *dev)
 static int pci_pm_suspend(struct device *dev)
 {
        struct pci_dev *pci_dev = to_pci_dev(dev);
-       struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
+       const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 
        if (pci_has_legacy_pm_support(pci_dev))
                return pci_legacy_suspend(dev, PMSG_SUSPEND);
 
-       pci_dev->state_saved = false;
-
        if (!pm) {
                pci_pm_default_suspend(pci_dev);
                goto Fixup;
@@ -641,7 +636,7 @@ static int pci_pm_suspend(struct device *dev)
 static int pci_pm_suspend_noirq(struct device *dev)
 {
        struct pci_dev *pci_dev = to_pci_dev(dev);
-       struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
+       const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 
        if (pci_has_legacy_pm_support(pci_dev))
                return pci_legacy_suspend_late(dev, PMSG_SUSPEND);
@@ -700,7 +695,7 @@ static int pci_pm_resume_noirq(struct device *dev)
 static int pci_pm_resume(struct device *dev)
 {
        struct pci_dev *pci_dev = to_pci_dev(dev);
-       struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
+       const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
        int error = 0;
 
        /*
@@ -739,13 +734,11 @@ static int pci_pm_resume(struct device *dev)
 static int pci_pm_freeze(struct device *dev)
 {
        struct pci_dev *pci_dev = to_pci_dev(dev);
-       struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
+       const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 
        if (pci_has_legacy_pm_support(pci_dev))
                return pci_legacy_suspend(dev, PMSG_FREEZE);
 
-       pci_dev->state_saved = false;
-
        if (!pm) {
                pci_pm_default_suspend(pci_dev);
                return 0;
@@ -808,7 +801,7 @@ static int pci_pm_thaw_noirq(struct device *dev)
 static int pci_pm_thaw(struct device *dev)
 {
        struct pci_dev *pci_dev = to_pci_dev(dev);
-       struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
+       const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
        int error = 0;
 
        if (pci_has_legacy_pm_support(pci_dev))
@@ -821,19 +814,19 @@ static int pci_pm_thaw(struct device *dev)
                pci_pm_reenable_device(pci_dev);
        }
 
+       pci_dev->state_saved = false;
+
        return error;
 }
 
 static int pci_pm_poweroff(struct device *dev)
 {
        struct pci_dev *pci_dev = to_pci_dev(dev);
-       struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
+       const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 
        if (pci_has_legacy_pm_support(pci_dev))
                return pci_legacy_suspend(dev, PMSG_HIBERNATE);
 
-       pci_dev->state_saved = false;
-
        if (!pm) {
                pci_pm_default_suspend(pci_dev);
                goto Fixup;
@@ -900,7 +893,7 @@ static int pci_pm_restore_noirq(struct device *dev)
 static int pci_pm_restore(struct device *dev)
 {
        struct pci_dev *pci_dev = to_pci_dev(dev);
-       struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
+       const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
        int error = 0;
 
        /*
@@ -938,7 +931,7 @@ static int pci_pm_restore(struct device *dev)
 
 #endif /* !CONFIG_HIBERNATION */
 
-struct dev_pm_ops pci_dev_pm_ops = {
+const struct dev_pm_ops pci_dev_pm_ops = {
        .prepare = pci_pm_prepare,
        .complete = pci_pm_complete,
        .suspend = pci_pm_suspend,