summaryrefslogtreecommitdiffstats
path: root/sys/dev/ips/ips_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ips/ips_pci.c')
-rw-r--r--sys/dev/ips/ips_pci.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/ips/ips_pci.c b/sys/dev/ips/ips_pci.c
index c4a2db3..80681c7 100644
--- a/sys/dev/ips/ips_pci.c
+++ b/sys/dev/ips/ips_pci.c
@@ -92,13 +92,15 @@ static int ips_pci_attach(device_t dev)
else
sc->rid = PCIR_BAR(1);
sc->iotype = SYS_RES_MEMORY;
- sc->iores = bus_alloc_resource(dev, sc->iotype, &sc->rid, 0, ~0, 1, RF_ACTIVE);
+ sc->iores = bus_alloc_resource_any(dev, sc->iotype,
+ &sc->rid, RF_ACTIVE);
}
if(!sc->iores && command & PCIM_CMD_PORTEN){
PRINTF(10, "trying PORTIO\n");
sc->rid = PCIR_BAR(0);
sc->iotype = SYS_RES_IOPORT;
- sc->iores = bus_alloc_resource(dev, sc->iotype, &sc->rid, 0, ~0, 1, RF_ACTIVE);
+ sc->iores = bus_alloc_resource_any(dev, sc->iotype,
+ &sc->rid, RF_ACTIVE);
}
if(sc->iores == NULL){
device_printf(dev, "resource allocation failed\n");
@@ -108,7 +110,8 @@ static int ips_pci_attach(device_t dev)
sc->bushandle = rman_get_bushandle(sc->iores);
/*allocate an interrupt. when does the irq become active? after leaving attach? */
sc->irqrid = 0;
- if(!(sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqrid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE))){
+ if(!(sc->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ,
+ &sc->irqrid, RF_SHAREABLE | RF_ACTIVE))){
device_printf(dev, "irq allocation failed\n");
goto error;
}
OpenPOWER on IntegriCloud