Fix, I think, The second slot problem with Cirrus Logic PD6729/30 parts:

o Move initialization of the slot bst and bsh to inside the for loop.
o move sc there as well.
o Remove debug printf that prints the ID of the first slot twice.
o Use the sp for the relevant slot in getb, rather than for the 0th slot.
This commit is contained in:
imp 2001-09-21 06:45:35 +00:00
parent e279ed9c87
commit f2aa0dd8d5

View File

@ -1144,19 +1144,18 @@ pcic_pci_attach(device_t dev)
&sc->iorid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
if (sc->iores == NULL)
return (ENOMEM);
sp->bst = rman_get_bustag(sc->iores);
sp->bsh = rman_get_bushandle(sc->iores);
sp->controller = PCIC_PD672X;
sp->revision = 0;
sc->flags = PCIC_PD_POWER;
itm = pcic_pci_lookup(device_id, &pcic_pci_devs[0]);
for (i = 0; i < 2; i++) {
sp[i].bst = rman_get_bustag(sc->iores);
sp[i].bsh = rman_get_bushandle(sc->iores);
sp[i].sc = sc;
sp[i].revision = 0;
sp[i].getb = pcic_getb_io;
sp[i].putb = pcic_putb_io;
sp[i].offset = i * PCIC_SLOT_SIZE;
sp[i].controller = PCIC_PD672X;
printf("ID is 0x%x\n", sp[i].getb(sp, PCIC_ID_REV));
if ((sp[i].getb(sp, PCIC_ID_REV) & 0xc0) == 0x80)
if ((sp[i].getb(&sp[i], PCIC_ID_REV) & 0xc0) == 0x80)
sp[i].slt = (struct slot *) 1;
}
/*