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/alpha/tc | |
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/alpha/tc')
-rw-r--r-- | sys/alpha/tc/ioasic.c | 6 | ||||
-rw-r--r-- | sys/alpha/tc/tc.c | 3 | ||||
-rw-r--r-- | sys/alpha/tc/tcasic.c | 2 | ||||
-rw-r--r-- | sys/alpha/tc/tcds.c | 9 |
4 files changed, 15 insertions, 5 deletions
diff --git a/sys/alpha/tc/ioasic.c b/sys/alpha/tc/ioasic.c index c6dd884..2cfe603 100644 --- a/sys/alpha/tc/ioasic.c +++ b/sys/alpha/tc/ioasic.c @@ -173,6 +173,7 @@ ioasic_probe(device_t dev) static int ioasic_attach(device_t dev) { + device_t child; struct ioasic_softc* sc = IOASIC_SOFTC(dev); struct tc_attach_args *ta = device_get_ivars(dev); device_t parent = device_get_parent(dev); @@ -226,7 +227,10 @@ ioasic_attach(device_t dev) for (i = 0; i < ioasic_ndevs; i++) { ioasic_devs[i].iada_addr = sc->sc_base + ioasic_devs[i].iad_offset; - device_probe_and_attach(device_add_child(dev, ioasic_devs[i].iad_modname, -1, &ioasic_devs[i])); + + child = device_add_child(dev, ioasic_devs[i].iad_modname, -1); + device_set_ivars(child, &ioasic_devs[i]); + device_probe_and_attach(child); } return 0; } diff --git a/sys/alpha/tc/tc.c b/sys/alpha/tc/tc.c index 16d1552..7c34306 100644 --- a/sys/alpha/tc/tc.c +++ b/sys/alpha/tc/tc.c @@ -612,7 +612,8 @@ tc_attach(device_t dev) ta->ta_cookie = builtin->tcb_cookie; ta->ta_busspeed = sc->sc_speed; - child = device_add_child(dev, builtin->tcb_modname, 0, ta); + child = device_add_child(dev, builtin->tcb_modname, 0); + device_set_ivars(child, ta); device_probe_and_attach(child); } diff --git a/sys/alpha/tc/tcasic.c b/sys/alpha/tc/tcasic.c index 493b5ac..8a600f1 100644 --- a/sys/alpha/tc/tcasic.c +++ b/sys/alpha/tc/tcasic.c @@ -82,7 +82,7 @@ tcasic_probe(device_t dev) return ENXIO; tcasic0 = dev; device_set_desc(dev, "Turbochannel Host Bus Adapter"); - tc0 = device_add_child(dev, "tc", 0, 0); + tc0 = device_add_child(dev, "tc", 0); return 0; } diff --git a/sys/alpha/tc/tcds.c b/sys/alpha/tc/tcds.c index 4cedfbf..2fe9292 100644 --- a/sys/alpha/tc/tcds.c +++ b/sys/alpha/tc/tcds.c @@ -150,6 +150,7 @@ tcds_attach(device_t dev) struct tcds_softc* sc = TCDS_SOFTC(dev); struct tc_attach_args *ta = device_get_ivars(dev); device_t parent = device_get_parent(dev); + device_t child; vm_offset_t regs,va; u_long i; struct tcds_slotconfig *slotc; @@ -229,7 +230,9 @@ tcds_attach(device_t dev) tcdsdev->tcdsda_freq = 25000000; /* XXX */ tcds_scsi_reset(tcdsdev->tcdsda_sc); - device_probe_and_attach(device_add_child(dev, "esp", -1, tcdsdev)); + child = device_add_child(dev, "esp", -1); + device_set_ivars(child, tcdsdev); + device_probe_and_attach(child); } /* the second SCSI chip isn't present on the 3000/300 series. */ @@ -248,7 +251,9 @@ tcds_attach(device_t dev) tcdsdev->tcdsda_id = 7; /* XXX */ tcdsdev->tcdsda_freq = 25000000; /* XXX */ tcds_scsi_reset(tcdsdev->tcdsda_sc); - device_probe_and_attach(device_add_child(dev, "esp", -1, tcdsdev)); + child = device_add_child(dev, "esp", -1); + device_set_ivars(child, tcdsdev); + device_probe_and_attach(child); } } return 0; |