mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
PCI: fix issue with busses registering multiple times in sysfs
PCI busses can be registered multiple times, so we need to detect if we have registered our bus structure in sysfs already. If so, don't do it again. Thanks to Guennadi Liakhovetski <[email protected]> for reporting the problem, and to Linus for poking me to get me to believe that it was a real problem. Cc: Linus Torvalds <[email protected]> Cc: Guennadi Liakhovetski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
93d74463d0
commit
cc74d96f47
2 changed files with 6 additions and 1 deletions
|
|
@ -143,14 +143,18 @@ void pci_bus_add_devices(struct pci_bus *bus)
|
|||
/* register the bus with sysfs as the parent is now
|
||||
* properly registered. */
|
||||
child_bus = dev->subordinate;
|
||||
if (child_bus->is_added)
|
||||
continue;
|
||||
child_bus->dev.parent = child_bus->bridge;
|
||||
retval = device_register(&child_bus->dev);
|
||||
if (retval)
|
||||
dev_err(&dev->dev, "Error registering pci_bus,"
|
||||
" continuing...\n");
|
||||
else
|
||||
else {
|
||||
child_bus->is_added = 1;
|
||||
retval = device_create_file(&child_bus->dev,
|
||||
&dev_attr_cpuaffinity);
|
||||
}
|
||||
if (retval)
|
||||
dev_err(&dev->dev, "Error creating cpuaffinity"
|
||||
" file, continuing...\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue