diff options
Diffstat (limited to 'drivers/pci/bus.c')
-rw-r--r-- | drivers/pci/bus.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 9e5ea074ad20..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) | |||
108 | void pci_bus_add_devices(struct pci_bus *bus) | 108 | void 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 | } |
@@ -204,7 +213,6 @@ void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), | |||
204 | } | 213 | } |
205 | up_read(&pci_bus_sem); | 214 | up_read(&pci_bus_sem); |
206 | } | 215 | } |
207 | EXPORT_SYMBOL_GPL(pci_walk_bus); | ||
208 | 216 | ||
209 | EXPORT_SYMBOL(pci_bus_alloc_resource); | 217 | EXPORT_SYMBOL(pci_bus_alloc_resource); |
210 | EXPORT_SYMBOL_GPL(pci_bus_add_device); | 218 | EXPORT_SYMBOL_GPL(pci_bus_add_device); |