This patch updates pci_scan_bus_parented() and also has some important
fixes to the PCI bus class.
Signed-off-by: Adam Belay <[email protected]>
--- a/drivers/pci/bus/bus.c 2005-07-12 01:08:20.000000000 -0400
+++ b/drivers/pci/bus/bus.c 2005-07-13 02:01:57.000000000 -0400
@@ -81,7 +81,7 @@
bus->class_dev.class = &pcibus_class;
sprintf(bus->class_dev.class_id, "%04x:%02x", pci_domain_nr(bus),
- bus->primary);
+ bus->number);
ret = class_device_register(&bus->class_dev);
if (ret)
@@ -89,13 +89,15 @@
class_device_create_file(&bus->class_dev,
&class_device_attr_cpuaffinity);
- if (bus->self)
+ if (bus->bridge)
sysfs_create_link(&bus->class_dev.kobj,
- &bus->self->dev.kobj, "bridge");
+ &bus->bridge->kobj, "bridge");
- spin_lock(&pci_bus_lock);
- list_add_tail(&bus->node, &bus->parent->children);
- spin_unlock(&pci_bus_lock);
+ if (bus->parent) {
+ spin_lock(&pci_bus_lock);
+ list_add_tail(&bus->node, &bus->parent->children);
+ spin_unlock(&pci_bus_lock);
+ }
pci_proc_attach_bus(bus);
--- a/drivers/pci/bus/probe.c 2005-07-12 00:59:58.000000000 -0400
+++ b/drivers/pci/bus/probe.c 2005-07-13 01:58:54.000000000 -0400
@@ -427,37 +427,24 @@
error = device_register(dev);
if (error)
goto dev_reg_err;
+
b->bridge = get_device(dev);
+ b->number = b->secondary = bus;
+ b->resource[0] = &ioport_resource;
+ b->resource[1] = &iomem_resource;
- b->class_dev.class = &pcibus_class;
- sprintf(b->class_dev.class_id, "%04x:%02x", pci_domain_nr(b), bus);
- error = class_device_register(&b->class_dev);
- if (error)
- goto class_dev_reg_err;
- error = class_device_create_file(&b->class_dev, &class_device_attr_cpuaffinity);
+ error = pci_add_bus(b);
if (error)
- goto class_dev_create_file_err;
+ goto bus_class_reg_err;
/* Create legacy_io and legacy_mem files for this bus */
pci_create_legacy_files(b);
- error = sysfs_create_link(&b->class_dev.kobj, &b->bridge->kobj, "bridge");
- if (error)
- goto sys_create_link_err;
-
- b->number = b->secondary = bus;
- b->resource[0] = &ioport_resource;
- b->resource[1] = &iomem_resource;
-
b->subordinate = pci_scan_child_bus(b);
return b;
-sys_create_link_err:
- class_device_remove_file(&b->class_dev, &class_device_attr_cpuaffinity);
-class_dev_create_file_err:
- class_device_unregister(&b->class_dev);
-class_dev_reg_err:
+bus_class_reg_err:
device_unregister(dev);
dev_reg_err:
spin_lock(&pci_bus_lock);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
|
|