diff options
author | jhb <jhb@FreeBSD.org> | 2006-01-06 19:22:19 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-01-06 19:22:19 +0000 |
commit | 170b22254d46fd33c4a684276f37ca2d6aefb956 (patch) | |
tree | d2180db4affcce14d6d2578bb440ee40547b452b /sys | |
parent | 036bca428483e5d0565cb97310cc7fcee2975d20 (diff) | |
download | FreeBSD-src-170b22254d46fd33c4a684276f37ca2d6aefb956.zip FreeBSD-src-170b22254d46fd33c4a684276f37ca2d6aefb956.tar.gz |
- Make pcib_devclass private to sys/dev/pci/pci_pci.c and change all the
various pcib drivers to use their own private devclass_t variables for
their modules.
- Use the DEFINE_CLASS_0() macro to declare drivers for the various pcib
drivers while I'm here.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/mptable_pci.c | 17 | ||||
-rw-r--r-- | sys/amd64/pci/pci_bus.c | 14 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_pcib_acpi.c | 8 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_pcib_pci.c | 8 | ||||
-rw-r--r-- | sys/dev/pci/pci_pci.c | 9 | ||||
-rw-r--r-- | sys/dev/pci/pcib_private.h | 2 | ||||
-rw-r--r-- | sys/i386/i386/mptable_pci.c | 17 | ||||
-rw-r--r-- | sys/i386/pci/pci_bus.c | 24 | ||||
-rw-r--r-- | sys/powerpc/ofw/ofw_pcib_pci.c | 8 | ||||
-rw-r--r-- | sys/sparc64/pci/apb.c | 7 | ||||
-rw-r--r-- | sys/sparc64/pci/ofw_pcib.c | 8 |
11 files changed, 38 insertions, 84 deletions
diff --git a/sys/amd64/amd64/mptable_pci.c b/sys/amd64/amd64/mptable_pci.c index 5a34373..43e48b4 100644 --- a/sys/amd64/amd64/mptable_pci.c +++ b/sys/amd64/amd64/mptable_pci.c @@ -100,13 +100,10 @@ static device_method_t mptable_hostb_methods[] = { { 0, 0 } }; -static driver_t mptable_hostb_driver = { - "pcib", - mptable_hostb_methods, - 1, -}; +static devclass_t hostb_devclass; -DRIVER_MODULE(mptable_pcib, legacy, mptable_hostb_driver, pcib_devclass, 0, 0); +DEFINE_CLASS_0(pcib, mptable_hostb_driver, mptable_hostb_methods, 1); +DRIVER_MODULE(mptable_pcib, legacy, mptable_hostb_driver, hostb_devclass, 0, 0); /* PCI to PCI bridge driver. */ @@ -155,11 +152,9 @@ static device_method_t mptable_pcib_pci_methods[] = { {0, 0} }; -static driver_t mptable_pcib_driver = { - "pcib", - mptable_pcib_pci_methods, - sizeof(struct pcib_softc), -}; +static devclass_t pcib_devclass; +DEFINE_CLASS_0(pcib, mptable_pcib_driver, mptable_pcib_pci_methods, + sizeof(struct pcib_softc)); DRIVER_MODULE(mptable_pcib, pci, mptable_pcib_driver, pcib_devclass, 0, 0); diff --git a/sys/amd64/pci/pci_bus.c b/sys/amd64/pci/pci_bus.c index c3e4c96..c9a5ebf 100644 --- a/sys/amd64/pci/pci_bus.c +++ b/sys/amd64/pci/pci_bus.c @@ -326,12 +326,9 @@ static device_method_t legacy_pcib_methods[] = { { 0, 0 } }; -static driver_t legacy_pcib_driver = { - "pcib", - legacy_pcib_methods, - 1, -}; +static devclass_t pcib_devclass; +DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1); DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, pcib_devclass, 0, 0); @@ -377,12 +374,7 @@ static device_method_t pcibus_pnp_methods[] = { { 0, 0 } }; -static driver_t pcibus_pnp_driver = { - "pcibus_pnp", - pcibus_pnp_methods, - 1, /* no softc */ -}; - static devclass_t pcibus_pnp_devclass; +DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1); DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0); diff --git a/sys/dev/acpica/acpi_pcib_acpi.c b/sys/dev/acpica/acpi_pcib_acpi.c index e83e957..0e1a352 100644 --- a/sys/dev/acpica/acpi_pcib_acpi.c +++ b/sys/dev/acpica/acpi_pcib_acpi.c @@ -107,12 +107,10 @@ static device_method_t acpi_pcib_acpi_methods[] = { {0, 0} }; -static driver_t acpi_pcib_acpi_driver = { - "pcib", - acpi_pcib_acpi_methods, - sizeof(struct acpi_hpcib_softc), -}; +static devclass_t pcib_devclass; +DEFINE_CLASS_0(pcib, acpi_pcib_acpi_driver, acpi_pcib_acpi_methods, + sizeof(struct acpi_hpcib_softc)); DRIVER_MODULE(acpi_pcib, acpi, acpi_pcib_acpi_driver, pcib_devclass, 0, 0); MODULE_DEPEND(acpi_pcib, acpi, 1, 1, 1); diff --git a/sys/dev/acpica/acpi_pcib_pci.c b/sys/dev/acpica/acpi_pcib_pci.c index 5dd2509..c1d381d 100644 --- a/sys/dev/acpica/acpi_pcib_pci.c +++ b/sys/dev/acpica/acpi_pcib_pci.c @@ -97,12 +97,10 @@ static device_method_t acpi_pcib_pci_methods[] = { {0, 0} }; -static driver_t acpi_pcib_pci_driver = { - "pcib", - acpi_pcib_pci_methods, - sizeof(struct acpi_pcib_softc), -}; +static devclass_t pcib_devclass; +DEFINE_CLASS_0(pcib, acpi_pcib_pci_driver, acpi_pcib_pci_methods, + sizeof(struct acpi_pcib_softc)); DRIVER_MODULE(acpi_pcib, pci, acpi_pcib_pci_driver, pcib_devclass, 0, 0); MODULE_DEPEND(acpi_pcib, acpi, 1, 1, 1); diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 2795f02..586379b 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -83,14 +83,9 @@ static device_method_t pcib_methods[] = { { 0, 0 } }; -static driver_t pcib_driver = { - "pcib", - pcib_methods, - sizeof(struct pcib_softc), -}; - -devclass_t pcib_devclass; +static devclass_t pcib_devclass; +DEFINE_CLASS_0(pcib, pcib_driver, pcib_methods, sizeof(struct pcib_softc)); DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, 0, 0); /* diff --git a/sys/dev/pci/pcib_private.h b/sys/dev/pci/pcib_private.h index a4acaab..7ceb3db 100644 --- a/sys/dev/pci/pcib_private.h +++ b/sys/dev/pci/pcib_private.h @@ -75,6 +75,4 @@ uint32_t pcib_read_config(device_t dev, int b, int s, int f, int reg, int width) void pcib_write_config(device_t dev, int b, int s, int f, int reg, uint32_t val, int width); int pcib_route_interrupt(device_t pcib, device_t dev, int pin); -extern devclass_t pcib_devclass; - #endif diff --git a/sys/i386/i386/mptable_pci.c b/sys/i386/i386/mptable_pci.c index 5a34373..43e48b4 100644 --- a/sys/i386/i386/mptable_pci.c +++ b/sys/i386/i386/mptable_pci.c @@ -100,13 +100,10 @@ static device_method_t mptable_hostb_methods[] = { { 0, 0 } }; -static driver_t mptable_hostb_driver = { - "pcib", - mptable_hostb_methods, - 1, -}; +static devclass_t hostb_devclass; -DRIVER_MODULE(mptable_pcib, legacy, mptable_hostb_driver, pcib_devclass, 0, 0); +DEFINE_CLASS_0(pcib, mptable_hostb_driver, mptable_hostb_methods, 1); +DRIVER_MODULE(mptable_pcib, legacy, mptable_hostb_driver, hostb_devclass, 0, 0); /* PCI to PCI bridge driver. */ @@ -155,11 +152,9 @@ static device_method_t mptable_pcib_pci_methods[] = { {0, 0} }; -static driver_t mptable_pcib_driver = { - "pcib", - mptable_pcib_pci_methods, - sizeof(struct pcib_softc), -}; +static devclass_t pcib_devclass; +DEFINE_CLASS_0(pcib, mptable_pcib_driver, mptable_pcib_pci_methods, + sizeof(struct pcib_softc)); DRIVER_MODULE(mptable_pcib, pci, mptable_pcib_driver, pcib_devclass, 0, 0); diff --git a/sys/i386/pci/pci_bus.c b/sys/i386/pci/pci_bus.c index 06f84cc..6413d0e 100644 --- a/sys/i386/pci/pci_bus.c +++ b/sys/i386/pci/pci_bus.c @@ -538,13 +538,10 @@ static device_method_t legacy_pcib_methods[] = { { 0, 0 } }; -static driver_t legacy_pcib_driver = { - "pcib", - legacy_pcib_methods, - 1, -}; +static devclass_t hostb_devclass; -DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, pcib_devclass, 0, 0); +DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1); +DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0); /* @@ -589,14 +586,9 @@ static device_method_t pcibus_pnp_methods[] = { { 0, 0 } }; -static driver_t pcibus_pnp_driver = { - "pcibus_pnp", - pcibus_pnp_methods, - 1, /* no softc */ -}; - static devclass_t pcibus_pnp_devclass; +DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1); DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0); @@ -635,12 +627,10 @@ static device_method_t pcibios_pcib_pci_methods[] = { {0, 0} }; -static driver_t pcibios_pcib_driver = { - "pcib", - pcibios_pcib_pci_methods, - sizeof(struct pcib_softc), -}; +static devclass_t pcib_devclass; +DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods, + sizeof(struct pcib_softc)); DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0); static int diff --git a/sys/powerpc/ofw/ofw_pcib_pci.c b/sys/powerpc/ofw/ofw_pcib_pci.c index 6307d05..4cc73c4 100644 --- a/sys/powerpc/ofw/ofw_pcib_pci.c +++ b/sys/powerpc/ofw/ofw_pcib_pci.c @@ -75,12 +75,10 @@ static device_method_t ofw_pcib_pci_methods[] = { {0, 0} }; -static driver_t ofw_pcib_pci_driver = { - "pcib", - ofw_pcib_pci_methods, - sizeof(struct pcib_softc), -}; +static devclass_t pcib_devclass; +DEFINE_CLASS_0(pcib, ofw_pcib_pci_driver, ofw_pcib_pci_methods, + sizeof(struct pcib_softc)); DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_pci_driver, pcib_devclass, 0, 0); static int diff --git a/sys/sparc64/pci/apb.c b/sys/sparc64/pci/apb.c index 0e743b4..58ec72c 100644 --- a/sys/sparc64/pci/apb.c +++ b/sys/sparc64/pci/apb.c @@ -112,12 +112,9 @@ static device_method_t apb_methods[] = { { 0, 0 } }; -static driver_t apb_driver = { - "pcib", - apb_methods, - sizeof(struct apb_softc), -}; +static devclass_t pcib_devclass; +DEFINE_CLASS_0(pcib, apb_driver, apb_methods, sizeof(struct apb_softc)); DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0); /* APB specific registers */ diff --git a/sys/sparc64/pci/ofw_pcib.c b/sys/sparc64/pci/ofw_pcib.c index 0f10696..d4e627d 100644 --- a/sys/sparc64/pci/ofw_pcib.c +++ b/sys/sparc64/pci/ofw_pcib.c @@ -93,12 +93,10 @@ static device_method_t ofw_pcib_methods[] = { { 0, 0 } }; -static driver_t ofw_pcib_driver = { - "pcib", - ofw_pcib_methods, - sizeof(struct ofw_pcib_gen_softc), -}; +static devclass_t pcib_devclass; +DEFINE_CLASS_0(pcib, ofw_pcib_driver, ofw_pcib_methods, + sizeof(struct ofw_pcib_gen_softc)); DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0); static int |