From 5aa58b3e8fc5d1bdc1d58bbce8a2eebb4a8ae7b6 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 20 Jan 2006 22:00:50 +0000 Subject: 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. --- sys/dev/cardbus/cardbus.c | 1 - sys/dev/pci/pci.c | 2 +- sys/dev/pci/pci_private.h | 5 ++--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 85a8113e3c48a..523e1b980ba15 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -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); diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 89facc8cca271..08fd995494520 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -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); diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h index 06beee96c14d8..b6bbaa0633d78 100644 --- a/sys/dev/pci/pci_private.h +++ b/sys/dev/pci/pci_private.h @@ -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); -- cgit v1.3