diff --git a/sys/dev/if_ndis/if_ndis_pci.c b/sys/dev/if_ndis/if_ndis_pci.c index 872aa50cd84a..ff93df3fb341 100644 --- a/sys/dev/if_ndis/if_ndis_pci.c +++ b/sys/dev/if_ndis/if_ndis_pci.c @@ -116,8 +116,8 @@ ndis_devcompare(bustype, t, dev) while(t->ndis_name != NULL) { if ((pci_get_vendor(dev) == t->ndis_vid) && (pci_get_device(dev) == t->ndis_did) && - ((pci_read_config(dev, PCIR_SUBVEND_0, 4) == - t->ndis_subsys) || t->ndis_subsys == 0)) { + (pci_get_subvendor(dev) == t->ndis_subsys || + t->ndis_subsys == 0)) { device_set_desc(dev, t->ndis_name); return(TRUE); } @@ -201,7 +201,6 @@ ndis_attach_pci(dev) error = ENXIO; goto fail; } - pci_enable_io(dev, SYS_RES_IOPORT); break; case SYS_RES_MEMORY: if (sc->ndis_res_altmem != NULL && @@ -239,7 +238,6 @@ ndis_attach_pci(dev) goto fail; } } - pci_enable_io(dev, SYS_RES_MEMORY); break; case SYS_RES_IRQ: rid = rle->rid; @@ -309,11 +307,8 @@ ndis_attach_pci(dev) (pci_get_device(dev) == t->ndis_did)) { if (t->ndis_subsys == 0) defidx = devidx; - else { - if (t->ndis_subsys == - pci_read_config(dev, PCIR_SUBVEND_0, 4)) - break; - } + else if (pci_get_subvendor(dev) == t->ndis_subsys) + break; } t++; devidx++; diff --git a/sys/dev/le/if_le_pci.c b/sys/dev/le/if_le_pci.c index ffa7cea7e324..404b1459ca9d 100644 --- a/sys/dev/le/if_le_pci.c +++ b/sys/dev/le/if_le_pci.c @@ -312,7 +312,6 @@ le_pci_attach(device_t dev) LE_LOCK_INIT(sc, device_get_nameunit(dev)); pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); i = PCIR_BAR(0); lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_IOPORT, diff --git a/sys/dev/malo/if_malo_pci.c b/sys/dev/malo/if_malo_pci.c index 65aac7ca63c2..c996658e53fb 100644 --- a/sys/dev/malo/if_malo_pci.c +++ b/sys/dev/malo/if_malo_pci.c @@ -149,21 +149,6 @@ malo_pci_probe(device_t dev) #undef N } -static int -malo_pci_setup(device_t dev) -{ - - /* - * Enable memory mapping and bus mastering. - */ - if (pci_enable_busmaster(dev) != 0) - return -1; - if (pci_enable_io(dev, SYS_RES_MEMORY) != 0) - return -1; - - return 0; -} - static int malo_pci_attach(device_t dev) { @@ -173,11 +158,7 @@ malo_pci_attach(device_t dev) sc->malo_dev = dev; - /* - * Enable memory mapping and bus mastering. - */ - if (malo_pci_setup(dev)) - return (ENXIO); + pci_enable_busmaster(dev); /* * Setup memory-mapping of PCI registers. @@ -342,9 +323,6 @@ malo_pci_resume(device_t dev) { struct malo_pci_softc *psc = device_get_softc(dev); - if (!malo_pci_setup(dev)) - return ENXIO; - malo_resume(&psc->malo_sc); return (0); diff --git a/sys/dev/sound/pci/atiixp.c b/sys/dev/sound/pci/atiixp.c index 5dd5f7a23f4b..9026e53bf377 100644 --- a/sys/dev/sound/pci/atiixp.c +++ b/sys/dev/sound/pci/atiixp.c @@ -1202,7 +1202,6 @@ atiixp_pci_attach(device_t dev) else sc->polling = 0; - pci_set_powerstate(dev, PCI_POWERSTATE_D0); pci_enable_busmaster(dev); sc->regid = PCIR_BAR(0); @@ -1354,7 +1353,6 @@ atiixp_pci_suspend(device_t dev) value = atiixp_rd(sc, ATI_REG_CMD); value |= ATI_REG_CMD_POWERDOWN | ATI_REG_CMD_AC_RESET; atiixp_wr(sc, ATI_REG_CMD, ATI_REG_CMD_POWERDOWN); - pci_set_powerstate(dev, PCI_POWERSTATE_D3); atiixp_unlock(sc); return (0); @@ -1366,10 +1364,6 @@ atiixp_pci_resume(device_t dev) struct atiixp_info *sc = pcm_getdevinfo(dev); atiixp_lock(sc); - /* power up pci bus */ - pci_set_powerstate(dev, PCI_POWERSTATE_D0); - pci_enable_io(dev, SYS_RES_MEMORY); - pci_enable_busmaster(dev); /* reset / power up aclink */ atiixp_reset_aclink(sc); atiixp_unlock(sc); diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c index 6fb8809cf916..4895ad626a23 100644 --- a/sys/dev/sound/pci/ich.c +++ b/sys/dev/sound/pci/ich.c @@ -1192,12 +1192,6 @@ ich_pci_resume(device_t dev) sc = pcm_getdevinfo(dev); - if (sc->regtype == SYS_RES_IOPORT) - pci_enable_io(dev, SYS_RES_IOPORT); - else - pci_enable_io(dev, SYS_RES_MEMORY); - pci_enable_busmaster(dev); - ICH_LOCK(sc); /* Reinit audio device */ if (ich_init(sc) == -1) {