diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2000-07-24 21:44:00 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2000-07-24 21:44:00 +0000 |
commit | add17facd3ce06dc1e311f52be4182e71291687f (patch) | |
tree | 9e2c88b68f46614e58d0a491930d75b1de63cef8 /sys/pccard/pcic.c | |
parent | 37687cde6a23692d42ec0c99f0e51fe5f98de548 (diff) | |
download | FreeBSD-src-add17facd3ce06dc1e311f52be4182e71291687f.zip FreeBSD-src-add17facd3ce06dc1e311f52be4182e71291687f.tar.gz |
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.
Diffstat (limited to 'sys/pccard/pcic.c')
-rw-r--r-- | sys/pccard/pcic.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |