diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 08:09:15 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 08:09:15 -0700 |
commit | ff0972c26bbf209da6f6d244cce60e695df863f6 (patch) | |
tree | 79db41583bf3847139ace7a6d1eff0266ea63bc2 /drivers/pci/bus.c | |
parent | a09fc446fb6d541281d9559fe7215d7c0d3cc9ce (diff) | |
parent | c9d86d76c1cdd76d67292ab75643db66573ca7dd (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (28 commits)
pciehp - fix wrong return value
IA64: PCI: dont disable irq which is not enabled
acpiphp: add support for ioapic hot-remove
PCI: assign ioapic resource at hotplug
acpiphp: disable bridges
acpiphp: stop bus device before acpi_bus_trim
PCI: add pci_stop_bus_device
acpiphp: do not initialize existing ioapics
acpiphp: initialize ioapics before starting devices
acpiphp: set hpp values before starting devices
PCI Hotplug: cleanup pcihp skeleton code.
PCI: Restore PCI Express capability registers after PM event
PCI: drivers/pci/hotplug/acpiphp_glue.c: make a function static
PCI: Multiprobe sanitizer
PCI: fix __must_check warnings
PCI Hotplug: fix __must_check warnings
SHPCHP: fix __must_check warnings
PCI-Express AER implemetation: pcie_portdrv error handler
PCI-Express AER implemetation: AER core and aerdriver
PCI-Express AER implemetation: export pcie_port_bus_type
...
Diffstat (limited to 'drivers/pci/bus.c')
-rw-r--r-- | drivers/pci/bus.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 5f7db9d2436..aadaa3c8096 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -77,9 +77,12 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, * This adds a single pci device to the global * device list and adds sysfs and procfs entries */ -void __devinit pci_bus_add_device(struct pci_dev *dev) +int __devinit pci_bus_add_device(struct pci_dev *dev) { - device_add(&dev->dev); + int retval; + retval = device_add(&dev->dev); + if (retval) + return retval; down_write(&pci_bus_sem); list_add_tail(&dev->global_list, &pci_devices); @@ -87,6 +90,7 @@ void __devinit pci_bus_add_device(struct pci_dev *dev) pci_proc_attach_device(dev); pci_create_sysfs_dev_files(dev); + return 0; } /** @@ -104,6 +108,7 @@ void __devinit pci_bus_add_device(struct pci_dev *dev) void __devinit pci_bus_add_devices(struct pci_bus *bus) { struct pci_dev *dev; + int retval; list_for_each_entry(dev, &bus->devices, bus_list) { /* @@ -112,7 +117,9 @@ void __devinit pci_bus_add_devices(struct pci_bus *bus) */ if (!list_empty(&dev->global_list)) continue; - pci_bus_add_device(dev); + retval = pci_bus_add_device(dev); + if (retval) + dev_err(&dev->dev, "Error adding device, continuing\n"); } list_for_each_entry(dev, &bus->devices, bus_list) { @@ -129,10 +136,13 @@ void __devinit pci_bus_add_devices(struct pci_bus *bus) list_add_tail(&dev->subordinate->node, &dev->bus->children); up_write(&pci_bus_sem); - } + } pci_bus_add_devices(dev->subordinate); - - sysfs_create_link(&dev->subordinate->class_dev.kobj, &dev->dev.kobj, "bridge"); + retval = sysfs_create_link(&dev->subordinate->class_dev.kobj, + &dev->dev.kobj, "bridge"); + if (retval) + dev_err(&dev->dev, "Error creating sysfs " + "bridge symlink, continuing...\n"); } } } |