summaryrefslogtreecommitdiffstats
path: root/sys/isa/atkbdc_isa.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-10-15 08:50:45 +0000
committerpeter <peter@FreeBSD.org>2000-10-15 08:50:45 +0000
commitaf84d4dcdc600d52abcbf06b7c8d10a58940f3d4 (patch)
tree8c787b24dfb44343a52eda4bca6d7c91ab56c980 /sys/isa/atkbdc_isa.c
parent9c029c0ce5709535e3b6879728a23184ca809eab (diff)
downloadFreeBSD-src-af84d4dcdc600d52abcbf06b7c8d10a58940f3d4.zip
FreeBSD-src-af84d4dcdc600d52abcbf06b7c8d10a58940f3d4.tar.gz
Untangle some resource matching loops that were getting on my nerves
and seemed to be getting cut/pasted to places they shouldn't be.
Diffstat (limited to 'sys/isa/atkbdc_isa.c')
-rw-r--r--sys/isa/atkbdc_isa.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/isa/atkbdc_isa.c b/sys/isa/atkbdc_isa.c
index 246e274..d2a4021 100644
--- a/sys/isa/atkbdc_isa.c
+++ b/sys/isa/atkbdc_isa.c
@@ -173,6 +173,7 @@ atkbdc_attach(device_t dev)
int error;
int rid;
int i;
+ const char *name;
unit = device_get_unit(dev);
sc = *(atkbdc_softc_t **)device_get_softc(dev);
@@ -213,22 +214,20 @@ atkbdc_attach(device_t dev)
/*
* Add all devices configured to be attached to atkbdc0.
*/
- for (i = resource_query_string(-1, "at", device_get_nameunit(dev));
- i != -1;
- i = resource_query_string(i, "at", device_get_nameunit(dev))) {
+ 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));
- }
/*
* and atkbdc?
*/
- for (i = resource_query_string(-1, "at", device_get_name(dev));
- i != -1;
- i = resource_query_string(i, "at", device_get_name(dev))) {
+ 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));
- }
bus_generic_attach(dev);
OpenPOWER on IntegriCloud