summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/atkbdc/atkbdc_isa.c18
-rw-r--r--sys/dev/atkbdc/atkbdc_subr.c18
-rw-r--r--sys/dev/fdc/fdc.c11
3 files changed, 21 insertions, 26 deletions
diff --git a/sys/dev/atkbdc/atkbdc_isa.c b/sys/dev/atkbdc/atkbdc_isa.c
index d99b648..2685164 100644
--- a/sys/dev/atkbdc/atkbdc_isa.c
+++ b/sys/dev/atkbdc/atkbdc_isa.c
@@ -169,11 +169,11 @@ static int
atkbdc_attach(device_t dev)
{
atkbdc_softc_t *sc;
- int unit;
+ int unit, dunit;
int error;
int rid;
int i;
- const char *name;
+ const char *name, *dname;
unit = device_get_unit(dev);
sc = *(atkbdc_softc_t **)device_get_softc(dev);
@@ -215,19 +215,17 @@ atkbdc_attach(device_t dev)
* Add all devices configured to be attached to atkbdc0.
*/
name = device_get_nameunit(dev);
- i = -1;
- while ((i = resource_query_string(i, "at", name)) != -1)
- atkbdc_add_device(dev, resource_query_name(i),
- resource_query_unit(i));
+ i = 0;
+ while ((resource_find_match(&i, &dname, &dunit, "at", name)) == 0)
+ atkbdc_add_device(dev, dname, dunit);
/*
* and atkbdc?
*/
name = device_get_name(dev);
- i = -1;
- while ((i = resource_query_string(i, "at", name)) != -1)
- atkbdc_add_device(dev, resource_query_name(i),
- resource_query_unit(i));
+ i = 0;
+ while ((resource_find_match(&i, &dname, &dunit, "at", name)) == 0)
+ atkbdc_add_device(dev, dname, dunit);
bus_generic_attach(dev);
diff --git a/sys/dev/atkbdc/atkbdc_subr.c b/sys/dev/atkbdc/atkbdc_subr.c
index d99b648..2685164 100644
--- a/sys/dev/atkbdc/atkbdc_subr.c
+++ b/sys/dev/atkbdc/atkbdc_subr.c
@@ -169,11 +169,11 @@ static int
atkbdc_attach(device_t dev)
{
atkbdc_softc_t *sc;
- int unit;
+ int unit, dunit;
int error;
int rid;
int i;
- const char *name;
+ const char *name, *dname;
unit = device_get_unit(dev);
sc = *(atkbdc_softc_t **)device_get_softc(dev);
@@ -215,19 +215,17 @@ atkbdc_attach(device_t dev)
* Add all devices configured to be attached to atkbdc0.
*/
name = device_get_nameunit(dev);
- i = -1;
- while ((i = resource_query_string(i, "at", name)) != -1)
- atkbdc_add_device(dev, resource_query_name(i),
- resource_query_unit(i));
+ i = 0;
+ while ((resource_find_match(&i, &dname, &dunit, "at", name)) == 0)
+ atkbdc_add_device(dev, dname, dunit);
/*
* and atkbdc?
*/
name = device_get_name(dev);
- i = -1;
- while ((i = resource_query_string(i, "at", name)) != -1)
- atkbdc_add_device(dev, resource_query_name(i),
- resource_query_unit(i));
+ i = 0;
+ while ((resource_find_match(&i, &dname, &dunit, "at", name)) == 0)
+ atkbdc_add_device(dev, dname, dunit);
bus_generic_attach(dev);
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 7524921..d29240e 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));
}
OpenPOWER on IntegriCloud