summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pcic_pci.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-09-21 06:45:35 +0000
committerimp <imp@FreeBSD.org>2001-09-21 06:45:35 +0000
commitf2aa0dd8d547b8e59cb855c4d443f7b1318a5cca (patch)
treec1016c73a052793c775b8a011a27cbedfa66ac9b /sys/pccard/pcic_pci.c
parente279ed9c878b969a72f4b17e41693416c413beb1 (diff)
downloadFreeBSD-src-f2aa0dd8d547b8e59cb855c4d443f7b1318a5cca.zip
FreeBSD-src-f2aa0dd8d547b8e59cb855c4d443f7b1318a5cca.tar.gz
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.
Diffstat (limited to 'sys/pccard/pcic_pci.c')
-rw-r--r--sys/pccard/pcic_pci.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/pccard/pcic_pci.c b/sys/pccard/pcic_pci.c
index 1d2b212..16d0324 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;
}
/*
OpenPOWER on IntegriCloud