From add17facd3ce06dc1e311f52be4182e71291687f Mon Sep 17 00:00:00 2001 From: iwasaki Date: Mon, 24 Jul 2000 21:44:00 +0000 Subject: Fix a bug so that we have correct number of pccard instances in pcic_attach(). pcic_attach() got a wrong pointer to pcic_slots since device haven't set correct unit number yet, so always accessed elements of pcic_slots which belong to pcic0 (unit number 0). Now we set unit number to pcic device first, then access to pcic_slots based on the unit number we've just set. --- sys/pccard/pcic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/pccard/pcic.c') diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c index 7fb7d7d..4ba9b5c 100644 --- a/sys/pccard/pcic.c +++ b/sys/pccard/pcic.c @@ -499,12 +499,12 @@ pcic_attach(device_t dev) struct pcic_slot *sp; int i; + SET_UNIT(dev, validunits); sp = &pcic_slots[GET_UNIT(dev) * PCIC_CARD_SLOTS]; for (i = 0; i < PCIC_CARD_SLOTS; i++, sp++) { if (sp->slt) device_add_child(dev, NULL, -1); } - SET_UNIT(dev, validunits); validunits++; rid = 0; -- cgit v1.1