summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/if_ndis/if_ndis_pci.c13
-rw-r--r--sys/dev/le/if_le_pci.c1
-rw-r--r--sys/dev/malo/if_malo_pci.c24
-rw-r--r--sys/dev/sound/pci/atiixp.c6
-rw-r--r--sys/dev/sound/pci/ich.c6
5 files changed, 5 insertions, 45 deletions
diff --git a/sys/dev/if_ndis/if_ndis_pci.c b/sys/dev/if_ndis/if_ndis_pci.c
index 872aa50..ff93df3 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 ffa7cea..404b145 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 65aac7c..c996658 100644
--- a/sys/dev/malo/if_malo_pci.c
+++ b/sys/dev/malo/if_malo_pci.c
@@ -150,21 +150,6 @@ malo_pci_probe(device_t dev)
}
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)
{
int error = ENXIO, i, msic, reg;
@@ -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 5dd5f7a..9026e53 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 6fb8809..4895ad6 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) {
OpenPOWER on IntegriCloud