summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sound/pci')
-rw-r--r--sys/dev/sound/pci/als4000.c4
-rw-r--r--sys/dev/sound/pci/au88x0.c12
-rw-r--r--sys/dev/sound/pci/aureal.c12
-rw-r--r--sys/dev/sound/pci/cmi.c4
-rw-r--r--sys/dev/sound/pci/cs4281.c4
-rw-r--r--sys/dev/sound/pci/csa.c9
-rw-r--r--sys/dev/sound/pci/csamidi.c9
-rw-r--r--sys/dev/sound/pci/csapcm.c9
-rw-r--r--sys/dev/sound/pci/ds1.c8
-rw-r--r--sys/dev/sound/pci/emu10k1.c5
-rw-r--r--sys/dev/sound/pci/es137x.c12
-rw-r--r--sys/dev/sound/pci/fm801.c17
-rw-r--r--sys/dev/sound/pci/ich.c9
-rw-r--r--sys/dev/sound/pci/maestro3.c12
-rw-r--r--sys/dev/sound/pci/neomagic.c18
-rw-r--r--sys/dev/sound/pci/solo.c13
-rw-r--r--sys/dev/sound/pci/t4dwave.c7
-rw-r--r--sys/dev/sound/pci/via8233.c8
-rw-r--r--sys/dev/sound/pci/via82c686.c6
19 files changed, 97 insertions, 81 deletions
diff --git a/sys/dev/sound/pci/als4000.c b/sys/dev/sound/pci/als4000.c
index 9add8d5..267c506 100644
--- a/sys/dev/sound/pci/als4000.c
+++ b/sys/dev/sound/pci/als4000.c
@@ -723,8 +723,8 @@ als_resource_grab(device_t dev, struct sc_info *sc)
sc->st = rman_get_bustag(sc->reg);
sc->sh = rman_get_bushandle(sc->reg);
- sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, 0, ~0, 1,
- RF_ACTIVE | RF_SHAREABLE);
+ sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (sc->irq == 0) {
device_printf(dev, "unable to allocate interrupt\n");
goto bad;
diff --git a/sys/dev/sound/pci/au88x0.c b/sys/dev/sound/pci/au88x0.c
index 12691cd..67bc5c2 100644
--- a/sys/dev/sound/pci/au88x0.c
+++ b/sys/dev/sound/pci/au88x0.c
@@ -597,15 +597,15 @@ au88x0_pci_attach(device_t dev)
/* try memory-mapped I/O */
aui->aui_regid = PCIR_BAR(0);
aui->aui_regtype = SYS_RES_MEMORY;
- aui->aui_reg = bus_alloc_resource(dev, aui->aui_regtype,
- &aui->aui_regid, 0, ~0, 1, RF_ACTIVE);
+ aui->aui_reg = bus_alloc_resource_any(dev, aui->aui_regtype,
+ &aui->aui_regid, RF_ACTIVE);
}
if (aui->aui_reg == NULL && (config & PCIM_CMD_PORTEN)) {
/* fall back on port I/O */
aui->aui_regid = PCIR_BAR(0);
aui->aui_regtype = SYS_RES_IOPORT;
- aui->aui_reg = bus_alloc_resource(dev, aui->aui_regtype,
- &aui->aui_regid, 0, ~0, 1, RF_ACTIVE);
+ aui->aui_reg = bus_alloc_resource_any(dev, aui->aui_regtype,
+ &aui->aui_regid, RF_ACTIVE);
}
if (aui->aui_reg == NULL) {
/* both mmio and pio failed... */
@@ -618,8 +618,8 @@ au88x0_pci_attach(device_t dev)
/* IRQ mapping */
aui->aui_irqid = 0;
aui->aui_irqtype = SYS_RES_IRQ;
- aui->aui_irq = bus_alloc_resource(dev, aui->aui_irqtype,
- &aui->aui_irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ aui->aui_irq = bus_alloc_resource_any(dev, aui->aui_irqtype,
+ &aui->aui_irqid, RF_ACTIVE | RF_SHAREABLE);
if (aui->aui_irq == 0) {
device_printf(dev, "failed to map IRQ\n");
goto failed;
diff --git a/sys/dev/sound/pci/aureal.c b/sys/dev/sound/pci/aureal.c
index e11add8..e1cc64d 100644
--- a/sys/dev/sound/pci/aureal.c
+++ b/sys/dev/sound/pci/aureal.c
@@ -584,12 +584,12 @@ au_pci_attach(device_t dev)
#endif
regid[j] = PCIR_BAR(i);
type[j] = SYS_RES_MEMORY;
- reg[j] = bus_alloc_resource(dev, type[j], &regid[j],
- 0, ~0, 1, RF_ACTIVE);
+ reg[j] = bus_alloc_resource_any(dev, type[j], &regid[j],
+ RF_ACTIVE);
if (!reg[j]) {
type[j] = SYS_RES_IOPORT;
- reg[j] = bus_alloc_resource(dev, type[j], &regid[j],
- 0, ~0, 1, RF_ACTIVE);
+ reg[j] = bus_alloc_resource_any(dev, type[j],
+ &regid[j], RF_ACTIVE);
}
if (reg[j]) {
au->st[i] = rman_get_bustag(reg[j]);
@@ -618,8 +618,8 @@ au_pci_attach(device_t dev)
au_wr(au, 0, AU_REG_IRQEN, 0, 4);
irqid = 0;
- irq = bus_alloc_resource(dev, SYS_RES_IRQ, &irqid,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!irq || snd_setup_intr(dev, irq, 0, au_intr, au, &ih)) {
device_printf(dev, "unable to map interrupt\n");
goto bad;
diff --git a/sys/dev/sound/pci/cmi.c b/sys/dev/sound/pci/cmi.c
index 4fd7ee4..de5b386 100644
--- a/sys/dev/sound/pci/cmi.c
+++ b/sys/dev/sound/pci/cmi.c
@@ -860,8 +860,8 @@ cmi_attach(device_t dev)
sc->sh = rman_get_bushandle(sc->reg);
sc->irqid = 0;
- sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!sc->irq ||
snd_setup_intr(dev, sc->irq, INTR_MPSAFE, cmi_intr, sc, &sc->ih)) {
device_printf(dev, "cmi_attach: Unable to map interrupt\n");
diff --git a/sys/dev/sound/pci/cs4281.c b/sys/dev/sound/pci/cs4281.c
index 3396a9e..c20f431 100644
--- a/sys/dev/sound/pci/cs4281.c
+++ b/sys/dev/sound/pci/cs4281.c
@@ -810,8 +810,8 @@ cs4281_pci_attach(device_t dev)
}
sc->irqid = 0;
- sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!sc->irq) {
device_printf(dev, "unable to allocate interrupt\n");
goto bad;
diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c
index 3c45e19..5b28ecd 100644
--- a/sys/dev/sound/pci/csa.c
+++ b/sys/dev/sound/pci/csa.c
@@ -259,15 +259,18 @@ csa_attach(device_t dev)
scp->binfo.card = scp->card;
printf("csa: card is %s\n", scp->card->name);
resp->io_rid = PCIR_BAR(0);
- resp->io = bus_alloc_resource(dev, SYS_RES_MEMORY, &resp->io_rid, 0, ~0, 1, RF_ACTIVE);
+ resp->io = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &resp->io_rid, RF_ACTIVE);
if (resp->io == NULL)
return (ENXIO);
resp->mem_rid = PCIR_BAR(1);
- resp->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &resp->mem_rid, 0, ~0, 1, RF_ACTIVE);
+ resp->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &resp->mem_rid, RF_ACTIVE);
if (resp->mem == NULL)
goto err_io;
resp->irq_rid = 0;
- resp->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &resp->irq_rid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ resp->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
+ &resp->irq_rid, RF_ACTIVE | RF_SHAREABLE);
if (resp->irq == NULL)
goto err_mem;
diff --git a/sys/dev/sound/pci/csamidi.c b/sys/dev/sound/pci/csamidi.c
index 4b9ce3d..4f91b5f 100644
--- a/sys/dev/sound/pci/csamidi.c
+++ b/sys/dev/sound/pci/csamidi.c
@@ -530,17 +530,20 @@ static int
csamidi_allocres(sc_p scp, device_t dev)
{
if (scp->io == NULL) {
- scp->io = bus_alloc_resource(dev, SYS_RES_MEMORY, &scp->io_rid, 0, ~0, 1, RF_ACTIVE);
+ scp->io = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &scp->io_rid, RF_ACTIVE);
if (scp->io == NULL)
return (1);
}
if (scp->mem == NULL) {
- scp->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &scp->mem_rid, 0, ~0, 1, RF_ACTIVE);
+ scp->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &scp->mem_rid, RF_ACTIVE);
if (scp->mem == NULL)
return (1);
}
if (scp->irq == NULL) {
- scp->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &scp->irq_rid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ scp->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
+ &scp->irq_rid, RF_ACTIVE | RF_SHAREABLE);
if (scp->irq == NULL)
return (1);
}
diff --git a/sys/dev/sound/pci/csapcm.c b/sys/dev/sound/pci/csapcm.c
index bc2f3b3..47a2e07 100644
--- a/sys/dev/sound/pci/csapcm.c
+++ b/sys/dev/sound/pci/csapcm.c
@@ -660,17 +660,20 @@ csa_allocres(struct csa_info *csa, device_t dev)
resp = &csa->res;
if (resp->io == NULL) {
- resp->io = bus_alloc_resource(dev, SYS_RES_MEMORY, &resp->io_rid, 0, ~0, 1, RF_ACTIVE);
+ resp->io = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &resp->io_rid, RF_ACTIVE);
if (resp->io == NULL)
return (1);
}
if (resp->mem == NULL) {
- resp->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &resp->mem_rid, 0, ~0, 1, RF_ACTIVE);
+ resp->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &resp->mem_rid, RF_ACTIVE);
if (resp->mem == NULL)
return (1);
}
if (resp->irq == NULL) {
- resp->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &resp->irq_rid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ resp->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
+ &resp->irq_rid, RF_ACTIVE | RF_SHAREABLE);
if (resp->irq == NULL)
return (1);
}
diff --git a/sys/dev/sound/pci/ds1.c b/sys/dev/sound/pci/ds1.c
index 20fc56d..443b15a 100644
--- a/sys/dev/sound/pci/ds1.c
+++ b/sys/dev/sound/pci/ds1.c
@@ -954,8 +954,8 @@ ds_pci_attach(device_t dev)
data = pci_read_config(dev, PCIR_COMMAND, 2);
sc->regid = PCIR_BAR(0);
- sc->reg = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->regid,
- 0, ~0, 1, RF_ACTIVE);
+ sc->reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->regid,
+ RF_ACTIVE);
if (!sc->reg) {
device_printf(dev, "unable to map register space\n");
goto bad;
@@ -989,8 +989,8 @@ ds_pci_attach(device_t dev)
mixer_init(dev, ac97_getmixerclass(), codec);
sc->irqid = 0;
- sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, ds_intr, sc, &sc->ih)) {
device_printf(dev, "unable to map interrupt\n");
goto bad;
diff --git a/sys/dev/sound/pci/emu10k1.c b/sys/dev/sound/pci/emu10k1.c
index a7fd89c..2ef7aae 100644
--- a/sys/dev/sound/pci/emu10k1.c
+++ b/sys/dev/sound/pci/emu10k1.c
@@ -1909,8 +1909,7 @@ emu_pci_attach(device_t dev)
data = pci_read_config(dev, PCIR_COMMAND, 2);
i = PCIR_BAR(0);
- sc->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &i, 0, ~0, 1,
- RF_ACTIVE);
+ sc->reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &i, RF_ACTIVE);
if (sc->reg == NULL) {
device_printf(dev, "unable to map register space\n");
goto bad;
@@ -1942,7 +1941,7 @@ emu_pci_attach(device_t dev)
if (mixer_init(dev, ac97_getmixerclass(), codec) == -1) goto bad;
i = 0;
- sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &i, 0, ~0, 1,
+ sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i,
RF_ACTIVE | RF_SHAREABLE);
if (!sc->irq ||
snd_setup_intr(dev, sc->irq, INTR_MPSAFE, emu_intr, sc, &sc->ih)) {
diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c
index 2b4c5c3..5c6d147c 100644
--- a/sys/dev/sound/pci/es137x.c
+++ b/sys/dev/sound/pci/es137x.c
@@ -855,8 +855,8 @@ es_pci_attach(device_t dev)
if (mapped == 0 && (data & PCIM_CMD_MEMEN)) {
es->regid = MEM_MAP_REG;
es->regtype = SYS_RES_MEMORY;
- es->reg = bus_alloc_resource(dev, es->regtype, &es->regid,
- 0, ~0, 1, RF_ACTIVE);
+ es->reg = bus_alloc_resource_any(dev, es->regtype, &es->regid,
+ RF_ACTIVE);
if (es->reg) {
es->st = rman_get_bustag(es->reg);
es->sh = rman_get_bushandle(es->reg);
@@ -866,8 +866,8 @@ es_pci_attach(device_t dev)
if (mapped == 0 && (data & PCIM_CMD_PORTEN)) {
es->regid = PCIR_BAR(0);
es->regtype = SYS_RES_IOPORT;
- es->reg = bus_alloc_resource(dev, es->regtype, &es->regid,
- 0, ~0, 1, RF_ACTIVE);
+ es->reg = bus_alloc_resource_any(dev, es->regtype, &es->regid,
+ RF_ACTIVE);
if (es->reg) {
es->st = rman_get_bustag(es->reg);
es->sh = rman_get_bushandle(es->reg);
@@ -906,8 +906,8 @@ es_pci_attach(device_t dev)
} else goto bad;
es->irqid = 0;
- es->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &es->irqid,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ es->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &es->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!es->irq || snd_setup_intr(dev, es->irq, 0, es_intr, es, &es->ih)) {
device_printf(dev, "unable to map interrupt\n");
goto bad;
diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c
index 87a74f6..007df37 100644
--- a/sys/dev/sound/pci/fm801.c
+++ b/sys/dev/sound/pci/fm801.c
@@ -589,13 +589,15 @@ fm801_pci_attach(device_t dev)
for (i = 0; (mapped == 0) && (i < PCI_MAXMAPS_0); i++) {
fm801->regid = PCIR_BAR(i);
fm801->regtype = SYS_RES_MEMORY;
- fm801->reg = bus_alloc_resource(dev, fm801->regtype, &fm801->regid,
- 0, ~0, 1, RF_ACTIVE);
+ fm801->reg = bus_alloc_resource_any(dev, fm801->regtype,
+ &fm801->regid, RF_ACTIVE);
if(!fm801->reg)
{
fm801->regtype = SYS_RES_IOPORT;
- fm801->reg = bus_alloc_resource(dev, fm801->regtype, &fm801->regid,
- 0, ~0, 1, RF_ACTIVE);
+ fm801->reg = bus_alloc_resource_any(dev,
+ fm801->regtype,
+ &fm801->regid,
+ RF_ACTIVE);
}
if(fm801->reg) {
@@ -620,8 +622,8 @@ fm801_pci_attach(device_t dev)
if (mixer_init(dev, ac97_getmixerclass(), codec) == -1) goto oops;
fm801->irqid = 0;
- fm801->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &fm801->irqid,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ fm801->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &fm801->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!fm801->irq || snd_setup_intr(dev, fm801->irq, 0, fm801_intr, fm801, &fm801->ih)) {
device_printf(dev, "unable to map interrupt\n");
goto oops;
@@ -714,8 +716,7 @@ fm801_pci_probe( device_t dev )
regid = PCIR_BAR(0);
regtype = SYS_RES_IOPORT;
- reg = bus_alloc_resource(dev, regtype, &regid, 0, ~0, 1,
- RF_ACTIVE);
+ reg = bus_alloc_resource_any(dev, regtype, &regid, RF_ACTIVE);
if (reg == NULL)
return ENXIO;
diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c
index e1f9734..376fee8 100644
--- a/sys/dev/sound/pci/ich.c
+++ b/sys/dev/sound/pci/ich.c
@@ -708,8 +708,10 @@ ich_pci_attach(device_t dev)
sc->regtype = SYS_RES_IOPORT;
}
- sc->nambar = bus_alloc_resource(dev, sc->regtype, &sc->nambarid, 0, ~0, 1, RF_ACTIVE);
- sc->nabmbar = bus_alloc_resource(dev, sc->regtype, &sc->nabmbarid, 0, ~0, 1, RF_ACTIVE);
+ sc->nambar = bus_alloc_resource_any(dev, sc->regtype,
+ &sc->nambarid, RF_ACTIVE);
+ sc->nabmbar = bus_alloc_resource_any(dev, sc->regtype,
+ &sc->nabmbarid, RF_ACTIVE);
if (!sc->nambar || !sc->nabmbar) {
device_printf(dev, "unable to map IO port space\n");
@@ -730,7 +732,8 @@ ich_pci_attach(device_t dev)
}
sc->irqid = 0;
- sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, ich_intr, sc, &sc->ih)) {
device_printf(dev, "unable to map interrupt\n");
goto bad;
diff --git a/sys/dev/sound/pci/maestro3.c b/sys/dev/sound/pci/maestro3.c
index c70ce51..41d42ef 100644
--- a/sys/dev/sound/pci/maestro3.c
+++ b/sys/dev/sound/pci/maestro3.c
@@ -1111,12 +1111,12 @@ m3_pci_attach(device_t dev)
sc->regid = PCIR_BAR(0);
sc->regtype = SYS_RES_MEMORY;
- sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid,
- 0, ~0, 1, RF_ACTIVE);
+ sc->reg = bus_alloc_resource_any(dev, sc->regtype, &sc->regid,
+ RF_ACTIVE);
if (!sc->reg) {
sc->regtype = SYS_RES_IOPORT;
- sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid,
- 0, ~0, 1, RF_ACTIVE);
+ sc->reg = bus_alloc_resource_any(dev, sc->regtype, &sc->regid,
+ RF_ACTIVE);
}
if (!sc->reg) {
device_printf(dev, "unable to allocate register space\n");
@@ -1126,8 +1126,8 @@ m3_pci_attach(device_t dev)
sc->sh = rman_get_bushandle(sc->reg);
sc->irqid = 0;
- sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!sc->irq) {
device_printf(dev, "unable to allocate interrupt\n");
goto bad;
diff --git a/sys/dev/sound/pci/neomagic.c b/sys/dev/sound/pci/neomagic.c
index 47fffdd..be428e0 100644
--- a/sys/dev/sound/pci/neomagic.c
+++ b/sys/dev/sound/pci/neomagic.c
@@ -609,9 +609,9 @@ nm_pci_probe(device_t dev)
PCIM_CMD_BUSMASTEREN, 2);
sc->regid = PCIR_BAR(1);
- sc->reg = bus_alloc_resource(dev, SYS_RES_MEMORY,
- &sc->regid, 0, ~0, 1,
- RF_ACTIVE);
+ sc->reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &sc->regid,
+ RF_ACTIVE);
if (!sc->reg) {
device_printf(dev, "unable to map register space\n");
@@ -676,11 +676,11 @@ nm_pci_attach(device_t dev)
data = pci_read_config(dev, PCIR_COMMAND, 2);
sc->bufid = PCIR_BAR(0);
- sc->buf = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->bufid,
- 0, ~0, 1, RF_ACTIVE);
+ sc->buf = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->bufid,
+ RF_ACTIVE);
sc->regid = PCIR_BAR(1);
- sc->reg = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->regid,
- 0, ~0, 1, RF_ACTIVE);
+ sc->reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->regid,
+ RF_ACTIVE);
if (!sc->buf || !sc->reg) {
device_printf(dev, "unable to map register space\n");
@@ -697,8 +697,8 @@ nm_pci_attach(device_t dev)
if (mixer_init(dev, ac97_getmixerclass(), codec) == -1) goto bad;
sc->irqid = 0;
- sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!sc->irq || snd_setup_intr(dev, sc->irq, 0, nm_intr, sc, &sc->ih)) {
device_printf(dev, "unable to map interrupt\n");
goto bad;
diff --git a/sys/dev/sound/pci/solo.c b/sys/dev/sound/pci/solo.c
index 1e213b6..8990fef 100644
--- a/sys/dev/sound/pci/solo.c
+++ b/sys/dev/sound/pci/solo.c
@@ -850,22 +850,23 @@ ess_alloc_resources(struct ess_info *sc, device_t dev)
int rid;
rid = PCIR_BAR(0);
- sc->io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE);
+ sc->io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
rid = PCIR_BAR(1);
- sc->sb = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE);
+ sc->sb = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
rid = PCIR_BAR(2);
- sc->vc = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE);
+ sc->vc = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
rid = PCIR_BAR(3);
- sc->mpu = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE);
+ sc->mpu = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
rid = PCIR_BAR(4);
- sc->gp = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE);
+ sc->gp = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
rid = 0;
- sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+ RF_ACTIVE | RF_SHAREABLE);
return (sc->irq && sc->io && sc->sb && sc->vc && sc->mpu && sc->gp)? 0 : ENXIO;
}
diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c
index e2a62e1..a61be39 100644
--- a/sys/dev/sound/pci/t4dwave.c
+++ b/sys/dev/sound/pci/t4dwave.c
@@ -820,7 +820,8 @@ tr_pci_attach(device_t dev)
tr->regid = PCIR_BAR(0);
tr->regtype = SYS_RES_IOPORT;
- tr->reg = bus_alloc_resource(dev, tr->regtype, &tr->regid, 0, ~0, 1, RF_ACTIVE);
+ tr->reg = bus_alloc_resource_any(dev, tr->regtype, &tr->regid,
+ RF_ACTIVE);
if (tr->reg) {
tr->st = rman_get_bustag(tr->reg);
tr->sh = rman_get_bushandle(tr->reg);
@@ -842,8 +843,8 @@ tr_pci_attach(device_t dev)
if (mixer_init(dev, ac97_getmixerclass(), codec) == -1) goto bad;
tr->irqid = 0;
- tr->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &tr->irqid,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ tr->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &tr->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!tr->irq || snd_setup_intr(dev, tr->irq, INTR_MPSAFE, tr_intr, tr, &tr->ih)) {
device_printf(dev, "unable to map interrupt\n");
goto bad;
diff --git a/sys/dev/sound/pci/via8233.c b/sys/dev/sound/pci/via8233.c
index 1429a8a..3a346ae 100644
--- a/sys/dev/sound/pci/via8233.c
+++ b/sys/dev/sound/pci/via8233.c
@@ -766,8 +766,8 @@ via_attach(device_t dev)
pci_enable_busmaster(dev);
via->regid = PCIR_BAR(0);
- via->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &via->regid, 0, ~0,
- 1, RF_ACTIVE);
+ via->reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &via->regid,
+ RF_ACTIVE);
if (!via->reg) {
device_printf(dev, "cannot allocate bus resource.");
goto bad;
@@ -778,8 +778,8 @@ via_attach(device_t dev)
via->bufsz = pcm_getbuffersize(dev, 4096, VIA_DEFAULT_BUFSZ, 65536);
via->irqid = 0;
- via->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &via->irqid, 0, ~0, 1,
- RF_ACTIVE | RF_SHAREABLE);
+ via->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &via->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!via->irq ||
snd_setup_intr(dev, via->irq, 0, via_intr, via, &via->ih)) {
device_printf(dev, "unable to map interrupt\n");
diff --git a/sys/dev/sound/pci/via82c686.c b/sys/dev/sound/pci/via82c686.c
index c68887e..342ea54 100644
--- a/sys/dev/sound/pci/via82c686.c
+++ b/sys/dev/sound/pci/via82c686.c
@@ -507,7 +507,8 @@ via_attach(device_t dev)
}
via->regid = PCIR_BAR(0);
- via->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &via->regid, 0, ~0, 1, RF_ACTIVE);
+ via->reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
+ &via->regid, RF_ACTIVE);
if (!via->reg) {
device_printf(dev, "cannot allocate bus resource.");
goto bad;
@@ -518,7 +519,8 @@ via_attach(device_t dev)
via->bufsz = pcm_getbuffersize(dev, 4096, VIA_DEFAULT_BUFSZ, 65536);
via->irqid = 0;
- via->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &via->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ via->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &via->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!via->irq || snd_setup_intr(dev, via->irq, 0, via_intr, via, &via->ih)) {
device_printf(dev, "unable to map interrupt\n");
goto bad;
OpenPOWER on IntegriCloud