diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/bus.c | 3 | ||||
-rw-r--r-- | drivers/pci/pci-driver.c | 6 | ||||
-rw-r--r-- | drivers/pci/pci.c | 7 | ||||
-rw-r--r-- | drivers/pci/pcie/portdrv_pci.c | 8 |
4 files changed, 17 insertions, 7 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index fb9a11243d2a..a83ee0b85394 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c | |||
@@ -140,10 +140,11 @@ void __devinit pci_bus_add_devices(struct pci_bus *bus) | |||
140 | void pci_enable_bridges(struct pci_bus *bus) | 140 | void pci_enable_bridges(struct pci_bus *bus) |
141 | { | 141 | { |
142 | struct pci_dev *dev; | 142 | struct pci_dev *dev; |
143 | int retval; | ||
143 | 144 | ||
144 | list_for_each_entry(dev, &bus->devices, bus_list) { | 145 | list_for_each_entry(dev, &bus->devices, bus_list) { |
145 | if (dev->subordinate) { | 146 | if (dev->subordinate) { |
146 | pci_enable_device(dev); | 147 | retval = pci_enable_device(dev); |
147 | pci_set_master(dev); | 148 | pci_set_master(dev); |
148 | pci_enable_bridges(dev->subordinate); | 149 | pci_enable_bridges(dev->subordinate); |
149 | } | 150 | } |
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 414c77299c7d..0d0d533894e0 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -272,17 +272,19 @@ static int pci_device_suspend(struct device * dev, pm_message_t state) | |||
272 | } | 272 | } |
273 | 273 | ||
274 | 274 | ||
275 | /* | 275 | /* |
276 | * Default resume method for devices that have no driver provided resume, | 276 | * Default resume method for devices that have no driver provided resume, |
277 | * or not even a driver at all. | 277 | * or not even a driver at all. |
278 | */ | 278 | */ |
279 | static void pci_default_resume(struct pci_dev *pci_dev) | 279 | static void pci_default_resume(struct pci_dev *pci_dev) |
280 | { | 280 | { |
281 | int retval; | ||
282 | |||
281 | /* restore the PCI config space */ | 283 | /* restore the PCI config space */ |
282 | pci_restore_state(pci_dev); | 284 | pci_restore_state(pci_dev); |
283 | /* if the device was enabled before suspend, reenable */ | 285 | /* if the device was enabled before suspend, reenable */ |
284 | if (pci_dev->is_enabled) | 286 | if (pci_dev->is_enabled) |
285 | pci_enable_device(pci_dev); | 287 | retval = pci_enable_device(pci_dev); |
286 | /* if the device was busmaster before the suspend, make it busmaster again */ | 288 | /* if the device was busmaster before the suspend, make it busmaster again */ |
287 | if (pci_dev->is_busmaster) | 289 | if (pci_dev->is_busmaster) |
288 | pci_set_master(pci_dev); | 290 | pci_set_master(pci_dev); |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 93ec158d06c1..afee2de3f323 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -444,8 +444,11 @@ pci_enable_device_bars(struct pci_dev *dev, int bars) | |||
444 | { | 444 | { |
445 | int err; | 445 | int err; |
446 | 446 | ||
447 | pci_set_power_state(dev, PCI_D0); | 447 | err = pci_set_power_state(dev, PCI_D0); |
448 | if ((err = pcibios_enable_device(dev, bars)) < 0) | 448 | if (err) |
449 | return err; | ||
450 | err = pcibios_enable_device(dev, bars); | ||
451 | if (err < 0) | ||
449 | return err; | 452 | return err; |
450 | return 0; | 453 | return 0; |
451 | } | 454 | } |
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 30bac7ed7c16..3c565ce7f77b 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
@@ -90,15 +90,19 @@ static void pcie_portdrv_save_config(struct pci_dev *dev) | |||
90 | pci_save_msi_state(dev); | 90 | pci_save_msi_state(dev); |
91 | } | 91 | } |
92 | 92 | ||
93 | static void pcie_portdrv_restore_config(struct pci_dev *dev) | 93 | static int pcie_portdrv_restore_config(struct pci_dev *dev) |
94 | { | 94 | { |
95 | struct pcie_port_device_ext *p_ext = pci_get_drvdata(dev); | 95 | struct pcie_port_device_ext *p_ext = pci_get_drvdata(dev); |
96 | int retval; | ||
96 | 97 | ||
97 | pci_restore_state(dev); | 98 | pci_restore_state(dev); |
98 | if (p_ext->interrupt_mode == PCIE_PORT_MSI_MODE) | 99 | if (p_ext->interrupt_mode == PCIE_PORT_MSI_MODE) |
99 | pci_restore_msi_state(dev); | 100 | pci_restore_msi_state(dev); |
100 | pci_enable_device(dev); | 101 | retval = pci_enable_device(dev); |
102 | if (retval) | ||
103 | return retval; | ||
101 | pci_set_master(dev); | 104 | pci_set_master(dev); |
105 | return 0; | ||
102 | } | 106 | } |
103 | 107 | ||
104 | /* | 108 | /* |