summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-07-08 18:56:58 +0000
committerjhb <jhb@FreeBSD.org>2003-07-08 18:56:58 +0000
commit810e95d9a74415521fcdc42fec34f678a610e04a (patch)
tree2c8ec1ca0802f7a41f339b63f59cd44e147b3eee /sys/dev
parent6c736e55e449a0fa1a9047c02939778d0d4687a4 (diff)
downloadFreeBSD-src-810e95d9a74415521fcdc42fec34f678a610e04a.zip
FreeBSD-src-810e95d9a74415521fcdc42fec34f678a610e04a.tar.gz
- Make the isab devclass global to allow for multiple ISA bridge drivers.
- Factor out code common to all ISA bridge drivers attach methods into a isab_attach() function. - Rename the PCI-ISA bridge driver's attach function to pci_isab_attach() and have it call isab_attach().
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/isa_pci.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sys/dev/pci/isa_pci.c b/sys/dev/pci/isa_pci.c
index 5690df1..3f1b779 100644
--- a/sys/dev/pci/isa_pci.c
+++ b/sys/dev/pci/isa_pci.c
@@ -42,6 +42,7 @@
#include <sys/bus.h>
#include <sys/rman.h>
+#include <isa/isavar.h>
#include <pci/pcivar.h>
#include <pci/pcireg.h>
@@ -54,7 +55,7 @@ struct isab_softc {
};
static int isab_probe(device_t dev);
-static int isab_attach(device_t dev);
+static int pci_isab_attach(device_t dev);
static int isab_detach(device_t dev);
static int isab_resume(device_t dev);
static int isab_suspend(device_t dev);
@@ -62,7 +63,7 @@ static int isab_suspend(device_t dev);
static device_method_t isab_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, isab_probe),
- DEVMETHOD(device_attach, isab_attach),
+ DEVMETHOD(device_attach, pci_isab_attach),
DEVMETHOD(device_detach, isab_detach),
DEVMETHOD(device_shutdown, bus_generic_shutdown),
DEVMETHOD(device_suspend, isab_suspend),
@@ -86,8 +87,6 @@ static driver_t isab_driver = {
sizeof(struct isab_softc),
};
-static devclass_t isab_devclass;
-
DRIVER_MODULE(isab, pci, isab_driver, isab_devclass, 0, 0);
/*
@@ -155,21 +154,17 @@ isab_probe(device_t dev)
}
static int
-isab_attach(device_t dev)
+pci_isab_attach(device_t dev)
{
- device_t child;
struct isab_softc *sc = device_get_softc(dev);
int error, rid;
/*
* Attach an ISA bus. Note that we can only have one ISA bus.
*/
- child = device_add_child(dev, "isa", 0);
- if (child != NULL) {
- error = bus_generic_attach(dev);
- if (error)
- return (error);
- }
+ error = isab_attach(dev);
+ if (error)
+ return (error);
switch (pci_get_devid(dev)) {
case 0x71108086: /* Intel 82371AB */
OpenPOWER on IntegriCloud