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