aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/bus.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-05-22 22:47:54 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-02-01 18:04:31 -0500
commitfd7d1ced29e5beb88c9068801da7a362606d8273 (patch)
tree40bfac045b8f7e6b94da04f76ed402395edc45cf /drivers/pci/bus.c
parent05cca6e52a5a75ffd491fb50a9f636075b2d77ba (diff)
PCI: make pci_bus a struct device
This moves the pci_bus class device to be a real struct device and at the same time, place it in the device tree in the correct location. Note, the old "bridge" symlink is now gone, but this was a non-standard link and no userspace program used it. If you need to determine the device that the bus is on, follow the standard device symlink, or walk up the device tree. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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}