diff options
author | mdodd <mdodd@FreeBSD.org> | 1999-12-03 08:41:24 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 1999-12-03 08:41:24 +0000 |
commit | 87e31f4b90cff07f3812e55d1980e47ac53a3904 (patch) | |
tree | 45f3bb4d1df765c421992403379a9575229036d0 /sys/i386 | |
parent | d7c9e9ad5f8564f402794c5a8175fffea1a5376e (diff) | |
download | FreeBSD-src-87e31f4b90cff07f3812e55d1980e47ac53a3904.zip FreeBSD-src-87e31f4b90cff07f3812e55d1980e47ac53a3904.tar.gz |
Remove the 'ivars' arguement to device_add_child() and
device_add_child_ordered(). 'ivars' may now be set using the
device_set_ivars() function.
This makes it easier for us to change how arbitrary data structures are
associated with a device_t. Eventually we won't be modifying device_t
to add additional pointers for ivars, softc data etc.
Despite my best efforts I've probably forgotten something so let me know
if this breaks anything. I've been running with this change for months
and its been quite involved actually isolating all the changes from
the rest of the local changes in my tree.
Reviewed by: peter, dfr
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/eisa/eisaconf.c | 4 | ||||
-rw-r--r-- | sys/i386/i386/autoconf.c | 2 | ||||
-rw-r--r-- | sys/i386/i386/legacy.c | 9 | ||||
-rw-r--r-- | sys/i386/i386/nexus.c | 9 | ||||
-rw-r--r-- | sys/i386/isa/pcf.c | 2 | ||||
-rw-r--r-- | sys/i386/isa/pcibus.c | 2 | ||||
-rw-r--r-- | sys/i386/pci/pci_bus.c | 2 | ||||
-rw-r--r-- | sys/i386/pci/pci_cfgreg.c | 2 | ||||
-rw-r--r-- | sys/i386/pci/pci_pir.c | 2 |
9 files changed, 19 insertions, 15 deletions
diff --git a/sys/i386/eisa/eisaconf.c b/sys/i386/eisa/eisaconf.c index d602305..59f553a 100644 --- a/sys/i386/eisa/eisaconf.c +++ b/sys/i386/eisa/eisaconf.c @@ -152,6 +152,7 @@ eisa_probe(device_t dev) { int i,slot; struct eisa_device *e_dev; + device_t child; int eisaBase = 0xc80; eisa_id_t eisa_id; int devices_found = 0; @@ -188,7 +189,8 @@ eisa_probe(device_t dev) LIST_INIT(&(e_dev->ioconf.maddrs)); TAILQ_INIT(&(e_dev->ioconf.irqs)); - device_add_child(dev, NULL, -1, e_dev); + child = device_add_child(dev, NULL, -1); + device_set_ivars(child, e_dev); } /* diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index 4f12924..877b326 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -136,7 +136,7 @@ configure(dummy) #endif /* APIC_IO */ /* nexus0 is the top of the i386 device tree */ - device_add_child(root_bus, "nexus", 0, 0); + device_add_child(root_bus, "nexus", 0); /* initialize new bus architecture */ root_bus_configure(); diff --git a/sys/i386/i386/legacy.c b/sys/i386/i386/legacy.c index ec9c186f..fda15bb 100644 --- a/sys/i386/i386/legacy.c +++ b/sys/i386/i386/legacy.c @@ -202,25 +202,26 @@ nexus_attach(device_t dev) * connection points now so they show up "on motherboard". */ if (!devclass_get_device(devclass_find("eisa"), 0)) { - child = device_add_child(dev, "eisa", 0, 0); + child = device_add_child(dev, "eisa", 0); if (child == NULL) panic("nexus_attach eisa"); device_probe_and_attach(child); } #if NMCA > 0 if (!devclass_get_device(devclass_find("mca"), 0)) { - child = device_add_child(dev, "mca", 0, 0); + child = device_add_child(dev, "mca", 0); if (child == 0) panic("nexus_probe mca"); device_probe_and_attach(child); } #endif if (!devclass_get_device(devclass_find("isa"), 0)) { - child = device_add_child(dev, "isa", 0, 0); + child = device_add_child(dev, "isa", 0); if (child == NULL) panic("nexus_attach isa"); device_probe_and_attach(child); } + return 0; } @@ -238,7 +239,7 @@ nexus_print_child(device_t bus, device_t child) static device_t nexus_add_child(device_t bus, int order, const char *name, int unit) { - return device_add_child_ordered(bus, order, name, unit, 0); + return device_add_child_ordered(bus, order, name, unit); } /* diff --git a/sys/i386/i386/nexus.c b/sys/i386/i386/nexus.c index ec9c186f..fda15bb 100644 --- a/sys/i386/i386/nexus.c +++ b/sys/i386/i386/nexus.c @@ -202,25 +202,26 @@ nexus_attach(device_t dev) * connection points now so they show up "on motherboard". */ if (!devclass_get_device(devclass_find("eisa"), 0)) { - child = device_add_child(dev, "eisa", 0, 0); + child = device_add_child(dev, "eisa", 0); if (child == NULL) panic("nexus_attach eisa"); device_probe_and_attach(child); } #if NMCA > 0 if (!devclass_get_device(devclass_find("mca"), 0)) { - child = device_add_child(dev, "mca", 0, 0); + child = device_add_child(dev, "mca", 0); if (child == 0) panic("nexus_probe mca"); device_probe_and_attach(child); } #endif if (!devclass_get_device(devclass_find("isa"), 0)) { - child = device_add_child(dev, "isa", 0, 0); + child = device_add_child(dev, "isa", 0); if (child == NULL) panic("nexus_attach isa"); device_probe_and_attach(child); } + return 0; } @@ -238,7 +239,7 @@ nexus_print_child(device_t bus, device_t child) static device_t nexus_add_child(device_t bus, int order, const char *name, int unit) { - return device_add_child_ordered(bus, order, name, unit, 0); + return device_add_child_ordered(bus, order, name, unit); } /* diff --git a/sys/i386/isa/pcf.c b/sys/i386/isa/pcf.c index 3cb86f7..1aeb7e6 100644 --- a/sys/i386/isa/pcf.c +++ b/sys/i386/isa/pcf.c @@ -164,7 +164,7 @@ pcfprobe_isa(struct isa_device *dvp) pcfdata[npcf++] = pcf; /* XXX add the pcf device to the root_bus until isa bus exists */ - pcfdev = device_add_child(root_bus, "pcf", pcf->pcf_unit, NULL); + pcfdev = device_add_child(root_bus, "pcf", pcf->pcf_unit); if (!pcfdev) goto error; diff --git a/sys/i386/isa/pcibus.c b/sys/i386/isa/pcibus.c index a640e14..609d416 100644 --- a/sys/i386/isa/pcibus.c +++ b/sys/i386/isa/pcibus.c @@ -478,7 +478,7 @@ static int nexus_pcib_probe(device_t dev) { if (pci_cfgopen() != 0) { - device_add_child(dev, "pci", device_get_unit(dev), 0); + device_add_child(dev, "pci", device_get_unit(dev)); return 0; } return ENXIO; diff --git a/sys/i386/pci/pci_bus.c b/sys/i386/pci/pci_bus.c index a640e14..609d416 100644 --- a/sys/i386/pci/pci_bus.c +++ b/sys/i386/pci/pci_bus.c @@ -478,7 +478,7 @@ static int nexus_pcib_probe(device_t dev) { if (pci_cfgopen() != 0) { - device_add_child(dev, "pci", device_get_unit(dev), 0); + device_add_child(dev, "pci", device_get_unit(dev)); return 0; } return ENXIO; diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c index a640e14..609d416 100644 --- a/sys/i386/pci/pci_cfgreg.c +++ b/sys/i386/pci/pci_cfgreg.c @@ -478,7 +478,7 @@ static int nexus_pcib_probe(device_t dev) { if (pci_cfgopen() != 0) { - device_add_child(dev, "pci", device_get_unit(dev), 0); + device_add_child(dev, "pci", device_get_unit(dev)); return 0; } return ENXIO; diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c index a640e14..609d416 100644 --- a/sys/i386/pci/pci_pir.c +++ b/sys/i386/pci/pci_pir.c @@ -478,7 +478,7 @@ static int nexus_pcib_probe(device_t dev) { if (pci_cfgopen() != 0) { - device_add_child(dev, "pci", device_get_unit(dev), 0); + device_add_child(dev, "pci", device_get_unit(dev)); return 0; } return ENXIO; |