summaryrefslogtreecommitdiffstats
path: root/sys/isa
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>1999-12-03 08:41:24 +0000
committermdodd <mdodd@FreeBSD.org>1999-12-03 08:41:24 +0000
commit87e31f4b90cff07f3812e55d1980e47ac53a3904 (patch)
tree45f3bb4d1df765c421992403379a9575229036d0 /sys/isa
parentd7c9e9ad5f8564f402794c5a8175fffea1a5376e (diff)
downloadFreeBSD-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/isa')
-rw-r--r--sys/isa/atkbdc_isa.c3
-rw-r--r--sys/isa/fd.c3
-rw-r--r--sys/isa/isa_common.c6
-rw-r--r--sys/isa/vga_isa.c2
4 files changed, 10 insertions, 4 deletions
diff --git a/sys/isa/atkbdc_isa.c b/sys/isa/atkbdc_isa.c
index eae6e14..9829f2b 100644
--- a/sys/isa/atkbdc_isa.c
+++ b/sys/isa/atkbdc_isa.c
@@ -137,7 +137,8 @@ atkbdc_add_device(device_t dev, const char *name, int unit)
else
kdev->flags = 0;
- child = device_add_child(dev, name, unit, kdev);
+ child = device_add_child(dev, name, unit);
+ device_set_ivars(child, kdev);
}
static int
diff --git a/sys/isa/fd.c b/sys/isa/fd.c
index da131e1..69e9795 100644
--- a/sys/isa/fd.c
+++ b/sys/isa/fd.c
@@ -772,7 +772,8 @@ fdc_add_device(device_t dev, const char *name, int unit)
return;
if (resource_int_value(name, unit, "drive", ivar) != 0)
*ivar = 0;
- child = device_add_child(dev, name, unit, ivar);
+ child = device_add_child(dev, name, unit);
+ device_set_ivars(child, ivar);
if (child == 0)
return;
if (resource_int_value(name, unit, "disabled", &disabled) == 0
diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c
index 9202754..a2478a1 100644
--- a/sys/isa/isa_common.c
+++ b/sys/isa/isa_common.c
@@ -519,6 +519,7 @@ isa_probe_children(device_t dev)
static device_t
isa_add_child(device_t dev, int order, const char *name, int unit)
{
+ device_t child;
struct isa_device *idev;
idev = malloc(sizeof(struct isa_device), M_ISADEV, M_NOWAIT);
@@ -529,7 +530,10 @@ isa_add_child(device_t dev, int order, const char *name, int unit)
resource_list_init(&idev->id_resources);
TAILQ_INIT(&idev->id_configs);
- return device_add_child_ordered(dev, order, name, unit, idev);
+ child = device_add_child_ordered(dev, order, name, unit);
+ device_set_ivars(child, idev);
+
+ return child;
}
static void
diff --git a/sys/isa/vga_isa.c b/sys/isa/vga_isa.c
index 0f0d81a..73b58d1 100644
--- a/sys/isa/vga_isa.c
+++ b/sys/isa/vga_isa.c
@@ -173,7 +173,7 @@ isavga_attach(device_t dev)
(*vidsw[sc->adp->va_index]->diag)(sc->adp, bootverbose);
#if experimental
- device_add_child(dev, "fb", -1, NULL);
+ device_add_child(dev, "fb", -1);
bus_generic_attach(dev);
#endif
OpenPOWER on IntegriCloud