aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/bus.c')
-rw-r--r--drivers/pci/bus.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index 863340a7b77f..ef5a6a245f5f 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -108,6 +108,7 @@ int pci_bus_add_device(struct pci_dev *dev)
108void pci_bus_add_devices(struct pci_bus *bus) 108void pci_bus_add_devices(struct pci_bus *bus)
109{ 109{
110 struct pci_dev *dev; 110 struct pci_dev *dev;
111 struct pci_bus *child_bus;
111 int retval; 112 int retval;
112 113
113 list_for_each_entry(dev, &bus->devices, bus_list) { 114 list_for_each_entry(dev, &bus->devices, bus_list) {
@@ -138,11 +139,19 @@ void pci_bus_add_devices(struct pci_bus *bus)
138 up_write(&pci_bus_sem); 139 up_write(&pci_bus_sem);
139 } 140 }
140 pci_bus_add_devices(dev->subordinate); 141 pci_bus_add_devices(dev->subordinate);
141 retval = sysfs_create_link(&dev->subordinate->class_dev.kobj, 142
142 &dev->dev.kobj, "bridge"); 143 /* register the bus with sysfs as the parent is now
144 * properly registered. */
145 child_bus = dev->subordinate;
146 child_bus->dev.parent = child_bus->bridge;
147 retval = device_register(&child_bus->dev);
148 if (!retval)
149 retval = device_create_file(&child_bus->dev,
150 &dev_attr_cpuaffinity);
143 if (retval) 151 if (retval)
144 dev_err(&dev->dev, "Error creating sysfs " 152 dev_err(&dev->dev, "Error registering pci_bus"
145 "bridge symlink, continuing...\n"); 153 " device bridge symlink,"
154 " continuing...\n");
146 } 155 }
147 } 156 }
148} 157}