Make the 'pci_devclass' pointer variable private (drivers really shouldn't

share devclass pointers, a mistake I've encouraged in the past) and
move the declaration of the pci_driver kobj class from cardbus.c to
pci_private.h so that other drivers can inherit from pci_driver.
This commit is contained in:
John Baldwin 2006-01-20 22:00:50 +00:00
parent 267ec43593
commit 5aa58b3e8f
3 changed files with 3 additions and 5 deletions

View file

@ -358,7 +358,6 @@ static device_method_t cardbus_methods[] = {
{0,0}
};
DECLARE_CLASS(pci_driver);
DEFINE_CLASS_1(cardbus, cardbus_driver, cardbus_methods,
sizeof(struct cardbus_softc), pci_driver);

View file

@ -137,7 +137,7 @@ static device_method_t pci_methods[] = {
DEFINE_CLASS_0(pci, pci_driver, pci_methods, 0);
devclass_t pci_devclass;
static devclass_t pci_devclass;
DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, 0);
MODULE_VERSION(pci, 1);

View file

@ -34,10 +34,9 @@
/*
* Export definitions of the pci bus so that we can more easily share
* it with "subclass" busses. A more generic subclassing mechanism would
* be nice, but is not present in the tree at this time.
* it with "subclass" busses.
*/
extern devclass_t pci_devclass;
DECLARE_CLASS(pci_driver);
void pci_add_children(device_t dev, int busno, size_t dinfo_size);
void pci_add_child(device_t bus, struct pci_devinfo *dinfo);