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.
This commit is contained in:
Mitsuru IWASAKI 2000-07-24 21:44:00 +00:00
parent cf8432359c
commit df56ce3e40

View File

@ -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;