Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sound/pci/hdspe.c
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static int | static int | ||||
hdspe_alloc_resources(struct sc_info *sc) | hdspe_alloc_resources(struct sc_info *sc) | ||||
{ | { | ||||
/* Allocate resource. */ | /* Allocate resource. */ | ||||
sc->csid = PCIR_BAR(0); | sc->csid = PCIR_BAR(0); | ||||
sc->cs = bus_alloc_resource(sc->dev, SYS_RES_MEMORY, | sc->cs = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, | ||||
&sc->csid, 0, ~0, 1, RF_ACTIVE); | &sc->csid, RF_ACTIVE); | ||||
if (!sc->cs) { | if (!sc->cs) { | ||||
device_printf(sc->dev, "Unable to map SYS_RES_MEMORY.\n"); | device_printf(sc->dev, "Unable to map SYS_RES_MEMORY.\n"); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
sc->cst = rman_get_bustag(sc->cs); | sc->cst = rman_get_bustag(sc->cs); | ||||
sc->csh = rman_get_bushandle(sc->cs); | sc->csh = rman_get_bushandle(sc->cs); | ||||
/* Allocate interrupt resource. */ | /* Allocate interrupt resource. */ | ||||
sc->irqid = 0; | sc->irqid = 0; | ||||
sc->irq = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irqid, | sc->irq = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &sc->irqid, | ||||
0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); | RF_ACTIVE | RF_SHAREABLE); | ||||
if (!sc->irq || | if (!sc->irq || | ||||
bus_setup_intr(sc->dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV, | bus_setup_intr(sc->dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV, | ||||
NULL, hdspe_intr, sc, &sc->ih)) { | NULL, hdspe_intr, sc, &sc->ih)) { | ||||
device_printf(sc->dev, "Unable to alloc interrupt resource.\n"); | device_printf(sc->dev, "Unable to alloc interrupt resource.\n"); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines |