From 2d45d0504cfe11ecbcd1072c3e12d302df41ba8f Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 21 Sep 2001 06:45:35 +0000 Subject: [PATCH] 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. --- sys/pccard/pcic_pci.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/pccard/pcic_pci.c b/sys/pccard/pcic_pci.c index 1d2b2121948..16d03242389 100644 --- a/sys/pccard/pcic_pci.c +++ b/sys/pccard/pcic_pci.c @@ -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; } /*