Index: dev/cardbus/cardbus_cis.c =================================================================== --- dev/cardbus/cardbus_cis.c (revision 201256) +++ dev/cardbus/cardbus_cis.c (working copy) @@ -482,14 +480,12 @@ return (NULL); } DEVPRINTF((cbdev, "CIS Mapped to %#lx\n", rman_get_start(res))); if (*rid == PCIR_BIOS) pci_write_config(child, *rid, rman_get_start(res) | PCIM_BIOS_ENABLE, 4); /* Flip to the right ROM image if CIS is in ROM */ if (space == PCIM_CIS_ASI_ROM) { - bus_space_tag_t bt; - bus_space_handle_t bh; uint32_t imagesize; uint32_t imagebase = 0; uint32_t pcidata; @@ -497,19 +490,16 @@ int romnum = 0; int imagenum; - bt = rman_get_bustag(res); - bh = rman_get_bushandle(res); - imagenum = (*start & PCIM_CIS_ROM_MASK) >> 28; for (romnum = 0;; romnum++) { - romsig = bus_space_read_2(bt, bh, + romsig = bus_read_2(res, imagebase + CARDBUS_EXROM_SIGNATURE); if (romsig != 0xaa55) { device_printf(cbdev, "Bad header in rom %d: " "[%x] %04x\n", romnum, imagebase + CARDBUS_EXROM_SIGNATURE, romsig); bus_release_resource(child, SYS_RES_MEMORY, *rid, res); *rid = 0; return (NULL); } @@ -522,9 +512,9 @@ break; /* Find out where the next Option ROM image is */ - pcidata = imagebase + bus_space_read_2(bt, bh, + pcidata = imagebase + bus_read_2(res, imagebase + CARDBUS_EXROM_DATA_PTR); - imagesize = bus_space_read_2(bt, bh, + imagesize = bus_read_2(res, pcidata + CARDBUS_EXROM_DATA_IMAGE_LENGTH); if (imagesize == 0) { @@ -541,7 +531,7 @@ /* Image size is in 512 byte units */ imagesize <<= 9; - if ((bus_space_read_1(bt, bh, pcidata + + if ((bus_read_1(res, pcidata + CARDBUS_EXROM_DATA_INDICATOR) & 0x80) != 0) { device_printf(cbdev, "Cannot find CIS in " "Option ROM\n");