PCI: check return value of pci_enable_device() when enabling bridges

pci_enable_device can fail. In that case, a printed warning would be
more appropriate.

Signed-off-by: Justin P. Mattock <[email protected]>
Signed-off-by: Junchang Wang <[email protected]>
Signed-off-by: Jesse Barnes <[email protected]>
This commit is contained in:
Junchang Wang 2010-06-18 10:02:33 +08:00 • committed by Jesse Barnes
commit 2eb5ebd366

View file

@ -240,6 +240,8 @@ void pci_enable_bridges(struct pci_bus *bus)
if (dev->subordinate) {
if (!pci_is_enabled(dev)) {
retval = pci_enable_device(dev);
if (retval)
dev_err(&dev->dev, "Error enabling bridge (%d), continuing\n", retval);
pci_set_master(dev);
}
pci_enable_bridges(dev->subordinate);