diff options
author | peter <peter@FreeBSD.org> | 2001-06-12 09:40:04 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-06-12 09:40:04 +0000 |
commit | bbbe8875f0844bdf4e10cbc01dc9c7f2a2c8368a (patch) | |
tree | ddf23af998adfeb85fbbf912b89e3fa83f84fd4b /sys/isa/isahint.c | |
parent | b44fc46ed5521eb3028aafbc0c4aef220ed24141 (diff) | |
download | FreeBSD-src-bbbe8875f0844bdf4e10cbc01dc9c7f2a2c8368a.zip FreeBSD-src-bbbe8875f0844bdf4e10cbc01dc9c7f2a2c8368a.tar.gz |
Hints overhaul:
- Replace some very poorly thought out API hacks that should have been
fixed a long while ago.
- Provide some much more flexible search functions (resource_find_*())
- Use strings for storage instead of an outgrowth of the rather
inconvenient temporary ioconf table from config(). We already had a
fallback to using strings before malloc/vm was running anyway.
Diffstat (limited to 'sys/isa/isahint.c')
-rw-r--r-- | sys/isa/isahint.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/sys/isa/isahint.c b/sys/isa/isahint.c index 8b21a62..12f32d2 100644 --- a/sys/isa/isahint.c +++ b/sys/isa/isahint.c @@ -87,30 +87,28 @@ isahint_identify(driver_t *driver, device_t parent) { int i; static char buf[] = "isaXXX"; + const char *dname; + int dunit; /* * Add all devices configured to be attached to parent. */ sprintf(buf, "isa%d", device_get_unit(parent)); - i = -1; - while ((i = resource_query_string(i, "at", buf)) != -1) { - if (strcmp(resource_query_name(i), "atkbd") == 0) + i = 0; + while ((resource_find_match(&i, &dname, &dunit, "at", buf)) == 0) { + if (strcmp(dname, "atkbd") == 0) continue; /* old GENERIC kludge */ - isahint_add_device(parent, - resource_query_name(i), - resource_query_unit(i)); + isahint_add_device(parent, dname, dunit); } /* * and isa? */ - i = -1; - while ((i = resource_query_string(i, "at", "isa")) != -1) { - if (strcmp(resource_query_name(i), "atkbd") == 0) + i = 0; + while ((resource_find_match(&i, &dname, &dunit, "at", "isa")) == 0) { + if (strcmp(dname, "atkbd") == 0) continue; /* old GENERIC kludge */ - isahint_add_device(parent, - resource_query_name(i), - resource_query_unit(i)); + isahint_add_device(parent, dname, dunit); } } |