legacy devices: Utilize bus_alloc_legacy_irq_resource()
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 11 Oct 2011 13:14:58 +0000 (21:14 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 11 Oct 2011 13:14:58 +0000 (21:14 +0800)
sys/dev/misc/lpt/lpt.c
sys/dev/misc/ppi/ppi.c
sys/dev/misc/pps/pps.c
sys/dev/netif/plip/if_plip.c
sys/net/i4b/layer1/ihfc/i4b_ihfc_pnp.c
sys/platform/pc32/isa/npx.c

index 648ee45..45168ca 100644 (file)
@@ -384,8 +384,8 @@ lpt_attach(device_t dev)
 
        if (irq > 0) {
                /* declare our interrupt handler */
-               sc->intr_resource = bus_alloc_resource(dev, SYS_RES_IRQ,
-                                                      &zero, irq, irq, 1, RF_SHAREABLE);
+               sc->intr_resource = bus_alloc_legacy_irq_resource(dev, &zero,
+                   irq, RF_SHAREABLE);
        }
        if (sc->intr_resource) {
                sc->sc_irq = LP_HAS_IRQ | LP_USE_IRQ | LP_ENABLE_IRQ;
index b503e5d..df955dc 100644 (file)
@@ -157,8 +157,8 @@ ppi_attach(device_t dev)
        BUS_READ_IVAR(device_get_parent(dev), dev, PPBUS_IVAR_IRQ, &irq);
 
        /* declare our interrupt handler */
-       ppi->intr_resource = bus_alloc_resource(dev, SYS_RES_IRQ,
-                                               &zero, irq, irq, 1, RF_ACTIVE);
+       ppi->intr_resource = bus_alloc_legacy_irq_resource(dev, &zero, irq,
+           RF_ACTIVE);
 #endif /* PERIPH_1284 */
 
        make_dev(&ppi_ops, device_get_unit(dev),        /* XXX cleanup */
index 4d91054..d84583b 100644 (file)
@@ -92,8 +92,8 @@ ppsattach(device_t ppsdev)
 
        if (irq > 0) {
                /* declare our interrupt handler */
-               sc->intr_resource = bus_alloc_resource(ppsdev, SYS_RES_IRQ,
-                                      &zero, irq, irq, 1, RF_SHAREABLE);
+               sc->intr_resource = bus_alloc_legacy_irq_resource(ppsdev,
+                   &zero, irq, RF_SHAREABLE);
        }
        /* interrupts seem mandatory */
        if (sc->intr_resource == 0)
index 25895e3..93c4b47 100644 (file)
@@ -204,8 +204,8 @@ lp_probe(device_t dev)
        }
 
        /* reserve the interrupt resource, expecting irq is available to continue */
-       lp->res_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &zero, irq, irq, 1, 
-                                        RF_SHAREABLE);
+       lp->res_irq = bus_alloc_legacy_irq_resource(dev, &zero, irq,
+           RF_SHAREABLE);
        if (lp->res_irq == 0) {
                device_printf(dev, "cannot reserve interrupt, failed.\n");
                return (ENXIO);
index 08c0cfe..0350e75 100644 (file)
@@ -260,9 +260,8 @@ ihfc_isa_probe(device_t dev)
 
   j0:  while(*irq)     /* get supported IRQ */
        {
-               if ((S_IRQ = bus_alloc_resource(
-                       dev, SYS_RES_IRQ, &S_IRQRID,
-                       *irq, *irq, 1, RF_ACTIVE
+               if ((S_IRQ = bus_alloc_legacy_irq_resource(
+                       dev, &S_IRQRID, *irq, RF_ACTIVE
                        )
                   ))
                                break;
index 776fb01..333015e 100644 (file)
@@ -379,9 +379,8 @@ npx_probe1(device_t dev)
                                if (r == 0)
                                        panic("npx: can't get ports");
                                rid = 0;
-                               r = bus_alloc_resource(dev, SYS_RES_IRQ,
-                                                      &rid, npx_irq, npx_irq,
-                                                      1, RF_ACTIVE);
+                               r = bus_alloc_legacy_irq_resource(dev, &rid,
+                                   npx_irq, RF_ACTIVE);
                                if (r == 0)
                                        panic("npx: can't get IRQ");
                                BUS_SETUP_INTR(device_get_parent(dev),