Commit 1781fe6e authored by Patrick Mochel's avatar Patrick Mochel

PCI: define pci_bus_type and register it on startup

parent 8f1640cb
...@@ -104,8 +104,8 @@ DRIVERS-y := ...@@ -104,8 +104,8 @@ DRIVERS-y :=
DRIVERS-m := DRIVERS-m :=
DRIVERS- := DRIVERS- :=
DRIVERS-$(CONFIG_ACPI) += drivers/acpi/acpi.o
DRIVERS-$(CONFIG_PCI) += drivers/pci/driver.o DRIVERS-$(CONFIG_PCI) += drivers/pci/driver.o
DRIVERS-$(CONFIG_ACPI) += drivers/acpi/acpi.o
DRIVERS-$(CONFIG_PARPORT) += drivers/parport/driver.o DRIVERS-$(CONFIG_PARPORT) += drivers/parport/driver.o
DRIVERS-y += drivers/base/base.o \ DRIVERS-y += drivers/base/base.o \
drivers/char/char.o \ drivers/char/char.o \
......
...@@ -164,6 +164,17 @@ struct device_driver pci_device_driver = { ...@@ -164,6 +164,17 @@ struct device_driver pci_device_driver = {
resume: pci_device_resume, resume: pci_device_resume,
}; };
struct bus_type pci_bus_type = {
name: "pci",
};
static int __init pci_driver_init(void)
{
return bus_register(&pci_bus_type);
}
subsys_initcall(pci_driver_init);
EXPORT_SYMBOL(pci_match_device); EXPORT_SYMBOL(pci_match_device);
EXPORT_SYMBOL(pci_register_driver); EXPORT_SYMBOL(pci_register_driver);
EXPORT_SYMBOL(pci_unregister_driver); EXPORT_SYMBOL(pci_unregister_driver);
......
...@@ -513,6 +513,7 @@ unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus) ...@@ -513,6 +513,7 @@ unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus)
dev0.sysdata = bus->sysdata; dev0.sysdata = bus->sysdata;
dev0.dev.parent = bus->dev; dev0.dev.parent = bus->dev;
dev0.dev.driver = &pci_device_driver; dev0.dev.driver = &pci_device_driver;
dev0.dev.bus = &pci_bus_type;
/* Go find them, Rover! */ /* Go find them, Rover! */
for (devfn = 0; devfn < 0x100; devfn += 8) { for (devfn = 0; devfn < 0x100; devfn += 8) {
......
...@@ -439,6 +439,7 @@ struct pci_bus { ...@@ -439,6 +439,7 @@ struct pci_bus {
extern struct list_head pci_root_buses; /* list of all known PCI buses */ extern struct list_head pci_root_buses; /* list of all known PCI buses */
extern struct list_head pci_devices; /* list of all devices */ extern struct list_head pci_devices; /* list of all devices */
extern struct bus_type pci_bus_type;
/* /*
* Error values that may be returned by PCI functions. * Error values that may be returned by PCI functions.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment