From 2398f0cd1d0f4da5f2004d4630b4bcbb11808c87 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Tue, 12 Jun 2001 09:40:04 +0000 Subject: 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. --- sys/dev/fdc/fdc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sys/dev/fdc') diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 7524921e38886..d29240e692248 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -817,8 +817,8 @@ static int fdc_attach(device_t dev) { struct fdc_data *fdc; - int i, error; - const char *name; + int i, error, dunit; + const char *name, *dname; fdc = device_get_softc(dev); error = fdc_alloc_resources(fdc); @@ -856,10 +856,9 @@ fdc_attach(device_t dev) * devices from the BIOS unless overridden. */ name = device_get_nameunit(dev); - i = -1; - while ((i = resource_query_string(i, "at", name)) != -1) - fdc_add_child(dev, resource_query_name(i), - resource_query_unit(i)); + i = 0; + while ((resource_find_match(&i, &dname, &dunit, "at", name)) == 0) + fdc_add_child(dev, dname, dunit); return (bus_generic_attach(dev)); } -- cgit v1.3