Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6:
PCI: fix issue with busses registering multiple times in sysfs

+6 -1
+5 -1
drivers/pci/bus.c
··· 143 143 /* register the bus with sysfs as the parent is now 144 144 * properly registered. */ 145 145 child_bus = dev->subordinate; 146 + if (child_bus->is_added) 147 + continue; 146 148 child_bus->dev.parent = child_bus->bridge; 147 149 retval = device_register(&child_bus->dev); 148 150 if (retval) 149 151 dev_err(&dev->dev, "Error registering pci_bus," 150 152 " continuing...\n"); 151 - else 153 + else { 154 + child_bus->is_added = 1; 152 155 retval = device_create_file(&child_bus->dev, 153 156 &dev_attr_cpuaffinity); 157 + } 154 158 if (retval) 155 159 dev_err(&dev->dev, "Error creating cpuaffinity" 156 160 " file, continuing...\n");
+1
include/linux/pci.h
··· 278 278 struct device dev; 279 279 struct bin_attribute *legacy_io; /* legacy I/O for this bus */ 280 280 struct bin_attribute *legacy_mem; /* legacy mem */ 281 + unsigned int is_added:1; 281 282 }; 282 283 283 284 #define pci_bus_b(n) list_entry(n, struct pci_bus, node)