diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-07-28 14:37:33 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-08 17:57:25 -0400 |
commit | 95a629657dbe28e44a312c47815b3dc3f1ce0970 (patch) | |
tree | 0e48656b5d61e26078a50af9f6766e52934fbedf /drivers | |
parent | 085ae41f66657a9655ce832b0a61832a06f0e1dc (diff) |
[PATCH] PCI: start paying attention to a lot of pci function return values
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-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 | ||||
-rw-r--r-- | drivers/usb/core/hcd-pci.c | 24 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 4 |
6 files changed, 39 insertions, 13 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 | /* |
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 7b9e54c39678..cbb451d227d2 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c | |||
@@ -260,8 +260,10 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t message) | |||
260 | retval = pci_set_power_state (dev, PCI_D3hot); | 260 | retval = pci_set_power_state (dev, PCI_D3hot); |
261 | if (retval == 0) { | 261 | if (retval == 0) { |
262 | dev_dbg (hcd->self.controller, "--> PCI D3\n"); | 262 | dev_dbg (hcd->self.controller, "--> PCI D3\n"); |
263 | pci_enable_wake (dev, PCI_D3hot, hcd->remote_wakeup); | 263 | retval = pci_enable_wake (dev, PCI_D3hot, hcd->remote_wakeup); |
264 | pci_enable_wake (dev, PCI_D3cold, hcd->remote_wakeup); | 264 | if (retval) |
265 | break; | ||
266 | retval = pci_enable_wake (dev, PCI_D3cold, hcd->remote_wakeup); | ||
265 | } else if (retval < 0) { | 267 | } else if (retval < 0) { |
266 | dev_dbg (&dev->dev, "PCI D3 suspend fail, %d\n", | 268 | dev_dbg (&dev->dev, "PCI D3 suspend fail, %d\n", |
267 | retval); | 269 | retval); |
@@ -335,8 +337,20 @@ int usb_hcd_pci_resume (struct pci_dev *dev) | |||
335 | dev->current_state); | 337 | dev->current_state); |
336 | } | 338 | } |
337 | #endif | 339 | #endif |
338 | pci_enable_wake (dev, dev->current_state, 0); | 340 | retval = pci_enable_wake (dev, dev->current_state, 0); |
339 | pci_enable_wake (dev, PCI_D3cold, 0); | 341 | if (retval) { |
342 | dev_err(hcd->self.controller, | ||
343 | "can't enable_wake to %d, %d!\n", | ||
344 | dev->current_state, retval); | ||
345 | return retval; | ||
346 | } | ||
347 | retval = pci_enable_wake (dev, PCI_D3cold, 0); | ||
348 | if (retval) { | ||
349 | dev_err(hcd->self.controller, | ||
350 | "can't enable_wake to %d, %d!\n", | ||
351 | PCI_D3cold, retval); | ||
352 | return retval; | ||
353 | } | ||
340 | } else { | 354 | } else { |
341 | /* Same basic cases: clean (powered/not), dirty */ | 355 | /* Same basic cases: clean (powered/not), dirty */ |
342 | dev_dbg(hcd->self.controller, "PCI legacy resume\n"); | 356 | dev_dbg(hcd->self.controller, "PCI legacy resume\n"); |
@@ -376,7 +390,7 @@ int usb_hcd_pci_resume (struct pci_dev *dev) | |||
376 | usb_hc_died (hcd); | 390 | usb_hc_died (hcd); |
377 | } | 391 | } |
378 | 392 | ||
379 | pci_enable_device(dev); | 393 | retval = pci_enable_device(dev); |
380 | return retval; | 394 | return retval; |
381 | } | 395 | } |
382 | EXPORT_SYMBOL (usb_hcd_pci_resume); | 396 | EXPORT_SYMBOL (usb_hcd_pci_resume); |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 149b13fc0a71..2507e898af09 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -549,7 +549,9 @@ static int ehci_start (struct usb_hcd *hcd) | |||
549 | hcd->can_wakeup = (port_wake & 1) != 0; | 549 | hcd->can_wakeup = (port_wake & 1) != 0; |
550 | 550 | ||
551 | /* help hc dma work well with cachelines */ | 551 | /* help hc dma work well with cachelines */ |
552 | pci_set_mwi (pdev); | 552 | retval = pci_set_mwi(pdev); |
553 | if (retval) | ||
554 | ehci_dbg(ehci, "unable to enable MWI - not fatal.\n"); | ||
553 | } | 555 | } |
554 | #endif | 556 | #endif |
555 | 557 | ||