Author: jhibbits
Date: Fri Feb 19 03:37:56 2016
New Revision: 295790
URL: https://svnweb.freebsd.org/changeset/base/295790

Log:
  Replace several bus_alloc_resource() calls using default arguments with 
bus_alloc_resource_any()
  
  Since these calls only use default arguments, bus_alloc_resource_any() is the
  right call.
  
  Differential Revision: https://reviews.freebsd.org/D5306

Modified:
  head/sys/dev/arcmsr/arcmsr.c
  head/sys/dev/cy/cy_isa.c
  head/sys/dev/cy/cy_pci.c
  head/sys/dev/ed/if_ed_pccard.c
  head/sys/dev/fb/s3_pci.c
  head/sys/dev/fdc/fdc_pccard.c
  head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
  head/sys/dev/hptiop/hptiop.c
  head/sys/dev/hptmv/entry.c
  head/sys/dev/hptnr/hptnr_osm_bsd.c
  head/sys/dev/hptrr/hptrr_osm_bsd.c
  head/sys/dev/isci/isci.c
  head/sys/dev/ixgb/if_ixgb.c
  head/sys/dev/lmc/if_lmc.c
  head/sys/dev/mrsas/mrsas.c
  head/sys/dev/mxge/if_mxge.c
  head/sys/dev/nvme/nvme_ctrlr.c
  head/sys/dev/quicc/quicc_core.c
  head/sys/dev/sound/pci/envy24.c
  head/sys/dev/sound/pci/envy24ht.c
  head/sys/dev/sound/pci/hdspe.c
  head/sys/dev/sound/pci/vibes.c
  head/sys/dev/twa/tw_osl_freebsd.c
  head/sys/dev/tws/tws.c
  head/sys/isa/isa_common.c
  head/sys/isa/vga_isa.c
  head/sys/mips/sibyte/ata_zbbus.c

Modified: head/sys/dev/arcmsr/arcmsr.c
==============================================================================
--- head/sys/dev/arcmsr/arcmsr.c        Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/arcmsr/arcmsr.c        Fri Feb 19 03:37:56 2016        
(r295790)
@@ -4323,7 +4323,7 @@ static int arcmsr_attach(device_t dev)
        }
        /* After setting up the adapter, map our interrupt */
        rid = 0;
-       irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1, 
RF_SHAREABLE | RF_ACTIVE);
+       irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | 
RF_ACTIVE);
        if(irqres == NULL || 
 #if __FreeBSD_version >= 700025
                bus_setup_intr(dev, irqres, 
INTR_TYPE_CAM|INTR_ENTROPY|INTR_MPSAFE, NULL, arcmsr_intr_handler, acb, 
&acb->ih)) {

Modified: head/sys/dev/cy/cy_isa.c
==============================================================================
--- head/sys/dev/cy/cy_isa.c    Fri Feb 19 02:03:14 2016        (r295789)
+++ head/sys/dev/cy/cy_isa.c    Fri Feb 19 03:37:56 2016        (r295790)
@@ -80,8 +80,8 @@ cy_isa_probe(device_t dev)
                return (ENXIO);
 
        mem_rid = 0;
-       mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid,
-           0ul, ~0ul, 0ul, RF_ACTIVE);
+       mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mem_rid,
+           RF_ACTIVE);
        if (mem_res == NULL) {
                device_printf(dev, "ioport resource allocation failed\n");
                return (ENXIO);
@@ -112,8 +112,8 @@ cy_isa_attach(device_t dev)
        mem_res = NULL;
 
        mem_rid = 0;
-       mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid,
-           0ul, ~0ul, 0ul, RF_ACTIVE);
+       mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mem_rid,
+           RF_ACTIVE);
        if (mem_res == NULL) {
                device_printf(dev, "memory resource allocation failed\n");
                goto fail;
@@ -127,7 +127,7 @@ cy_isa_attach(device_t dev)
        }
 
        irq_rid = 0;
-       irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, 0ul, ~0ul, 0ul,
+       irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irq_rid,
            RF_SHAREABLE | RF_ACTIVE);
        if (irq_res == NULL) {
                device_printf(dev, "interrupt resource allocation failed\n");

Modified: head/sys/dev/cy/cy_pci.c
==============================================================================
--- head/sys/dev/cy/cy_pci.c    Fri Feb 19 02:03:14 2016        (r295789)
+++ head/sys/dev/cy/cy_pci.c    Fri Feb 19 03:37:56 2016        (r295790)
@@ -114,8 +114,8 @@ cy_pci_attach(dev)
        mem_res = NULL;
 
        ioport_rid = CY_PCI_BASE_ADDR1;
-       ioport_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &ioport_rid,
-           0ul, ~0ul, 0ul, RF_ACTIVE);
+       ioport_res = bus_alloc_resource_(dev, SYS_RES_IOPORT, &ioport_rid,
+           RF_ACTIVE);
        if (ioport_res == NULL) {
                device_printf(dev, "ioport resource allocation failed\n");
                goto fail;
@@ -123,8 +123,8 @@ cy_pci_attach(dev)
        ioport = rman_get_start(ioport_res);
 
        mem_rid = CY_PCI_BASE_ADDR2;
-       mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid,
-           0ul, ~0ul, 0ul, RF_ACTIVE);
+       mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mem_rid,
+           RF_ACTIVE);
        if (mem_res == NULL) {
                device_printf(dev, "memory resource allocation failed\n");
                goto fail;
@@ -138,7 +138,7 @@ cy_pci_attach(dev)
        }
 
        irq_rid = 0;
-       irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, 0ul, ~0ul, 0ul,
+       irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irq_rid,
            RF_SHAREABLE | RF_ACTIVE);
        if (irq_res == NULL) {
                device_printf(dev, "interrupt resource allocation failed\n");

Modified: head/sys/dev/ed/if_ed_pccard.c
==============================================================================
--- head/sys/dev/ed/if_ed_pccard.c      Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/ed/if_ed_pccard.c      Fri Feb 19 03:37:56 2016        
(r295790)
@@ -509,8 +509,8 @@ ed_pccard_attach(device_t dev)
        }
        if (rman_get_size(sc->port_res) == ED_NOVELL_IO_PORTS / 2) {
                port_rid++;
-               sc->port_res2 = bus_alloc_resource(dev, SYS_RES_IOPORT,
-                   &port_rid, 0ul, ~0ul, 1, RF_ACTIVE);
+               sc->port_res2 = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
+                   &port_rid, RF_ACTIVE);
                if (sc->port_res2 == NULL ||
                    rman_get_size(sc->port_res2) != ED_NOVELL_IO_PORTS / 2) {
                        error = ENXIO;

Modified: head/sys/dev/fb/s3_pci.c
==============================================================================
--- head/sys/dev/fb/s3_pci.c    Fri Feb 19 02:03:14 2016        (r295789)
+++ head/sys/dev/fb/s3_pci.c    Fri Feb 19 03:37:56 2016        (r295790)
@@ -478,8 +478,8 @@ s3pci_attach(device_t dev)
        /* Allocate resources
         */
        rid = 0;
-       if (!(sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
-                               0ul, ~0ul, 0, RF_ACTIVE | RF_SHAREABLE))) {
+       if (!(sc->port_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,
+                               RF_ACTIVE | RF_SHAREABLE))) {
                printf("%s: port resource allocation failed!\n", __func__);
                goto error;
        }
@@ -487,8 +487,8 @@ s3pci_attach(device_t dev)
        sc->sh = rman_get_bushandle(sc->port_res);
 
        rid = 1;
-       if (!(sc->enh_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
-                               0ul, ~0ul, 0, RF_ACTIVE | RF_SHAREABLE))) {
+       if (!(sc->enh_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,
+                               RF_ACTIVE | RF_SHAREABLE))) {
                printf("%s: enhanced port resource allocation failed!\n",
                        __func__);
                goto error;

Modified: head/sys/dev/fdc/fdc_pccard.c
==============================================================================
--- head/sys/dev/fdc/fdc_pccard.c       Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/fdc/fdc_pccard.c       Fri Feb 19 03:37:56 2016        
(r295790)
@@ -56,8 +56,7 @@ fdc_pccard_alloc_resources(device_t dev,
        int rid, i;
 
        rid = 0;
-       res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0ul, ~0ul, 1,
-           RF_ACTIVE);
+       res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
        if (res == NULL) {
                device_printf(dev, "cannot alloc I/O port range\n");
                return (ENXIO);

Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
==============================================================================
--- head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c      Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c      Fri Feb 19 03:37:56 2016        
(r295790)
@@ -1260,8 +1260,8 @@ static void hpt_final_init(void *dummy)
 
                for (hba = vbus_ext->hba_list; hba; hba = hba->next) {
                        int rid = 0;
-                       if ((hba->irq_res = bus_alloc_resource(hba->pcidev,
-                               SYS_RES_IRQ, &rid, 0, ~0ul, 1, RF_SHAREABLE | 
RF_ACTIVE)) == NULL)
+                       if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev,
+                               SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)) 
== NULL)
                        {
                                os_printk("can't allocate interrupt");
                                return ;

Modified: head/sys/dev/hptiop/hptiop.c
==============================================================================
--- head/sys/dev/hptiop/hptiop.c        Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/hptiop/hptiop.c        Fri Feb 19 03:37:56 2016        
(r295790)
@@ -2052,8 +2052,8 @@ static int hptiop_attach(device_t dev)
        xpt_action((union ccb *)&ccb);
 
        rid = 0;
-       if ((hba->irq_res = bus_alloc_resource(hba->pcidev, SYS_RES_IRQ,
-                       &rid, 0, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL) {
+       if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev, SYS_RES_IRQ,
+                       &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) {
                device_printf(dev, "allocate irq failed!\n");
                goto free_hba_path;
        }

Modified: head/sys/dev/hptmv/entry.c
==============================================================================
--- head/sys/dev/hptmv/entry.c  Fri Feb 19 02:03:14 2016        (r295789)
+++ head/sys/dev/hptmv/entry.c  Fri Feb 19 03:37:56 2016        (r295790)
@@ -1990,7 +1990,7 @@ hpt_attach(device_t dev)
                return rid;
 
        rid = 0;
-       if ((pAdapter->hpt_irq = bus_alloc_resource(pAdapter->hpt_dev, 
SYS_RES_IRQ, &rid, 0, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL)
+       if ((pAdapter->hpt_irq = bus_alloc_resource_any(pAdapter->hpt_dev, 
SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL)
        {
                hpt_printk(("can't allocate interrupt\n"));
                return(ENXIO);

Modified: head/sys/dev/hptnr/hptnr_osm_bsd.c
==============================================================================
--- head/sys/dev/hptnr/hptnr_osm_bsd.c  Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/hptnr/hptnr_osm_bsd.c  Fri Feb 19 03:37:56 2016        
(r295790)
@@ -1445,8 +1445,8 @@ static void hpt_final_init(void *dummy)
 
                for (hba = vbus_ext->hba_list; hba; hba = hba->next) {
                        int rid = 0;
-                       if ((hba->irq_res = bus_alloc_resource(hba->pcidev,
-                               SYS_RES_IRQ, &rid, 0, ~0ul, 1, RF_SHAREABLE | 
RF_ACTIVE)) == NULL)
+                       if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev,
+                               SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)) 
== NULL)
                        {
                                os_printk("can't allocate interrupt");
                                return ;

Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c
==============================================================================
--- head/sys/dev/hptrr/hptrr_osm_bsd.c  Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/hptrr/hptrr_osm_bsd.c  Fri Feb 19 03:37:56 2016        
(r295790)
@@ -1093,8 +1093,8 @@ static void hpt_final_init(void *dummy)
 
                for (hba = vbus_ext->hba_list; hba; hba = hba->next) {
                        int rid = 0;
-                       if ((hba->irq_res = bus_alloc_resource(hba->pcidev,
-                               SYS_RES_IRQ, &rid, 0, ~0ul, 1, RF_SHAREABLE | 
RF_ACTIVE)) == NULL)
+                       if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev,
+                               SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)) 
== NULL)
                        {
                                os_printk("can't allocate interrupt");
                                return ;

Modified: head/sys/dev/isci/isci.c
==============================================================================
--- head/sys/dev/isci/isci.c    Fri Feb 19 02:03:14 2016        (r295789)
+++ head/sys/dev/isci/isci.c    Fri Feb 19 03:37:56 2016        (r295790)
@@ -138,8 +138,8 @@ isci_allocate_pci_memory(struct isci_sof
                struct ISCI_PCI_BAR *pci_bar = &isci->pci_bar[i];
 
                pci_bar->resource_id = PCIR_BAR(i*2);
-               pci_bar->resource = bus_alloc_resource(isci->device,
-                   SYS_RES_MEMORY, &pci_bar->resource_id, 0, ~0, 1,
+               pci_bar->resource = bus_alloc_resource_any(isci->device,
+                   SYS_RES_MEMORY, &pci_bar->resource_id,
                    RF_ACTIVE);
 
                if(pci_bar->resource == NULL)

Modified: head/sys/dev/ixgb/if_ixgb.c
==============================================================================
--- head/sys/dev/ixgb/if_ixgb.c Fri Feb 19 02:03:14 2016        (r295789)
+++ head/sys/dev/ixgb/if_ixgb.c Fri Feb 19 03:37:56 2016        (r295790)
@@ -1243,8 +1243,8 @@ ixgb_allocate_pci_resources(struct adapt
        device_t        dev = adapter->dev;
 
        rid = IXGB_MMBA;
-       adapter->res_memory = bus_alloc_resource(dev, SYS_RES_MEMORY,
-                                                &rid, 0, ~0, 1,
+       adapter->res_memory = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+                                                &rid,
                                                 RF_ACTIVE);
        if (!(adapter->res_memory)) {
                device_printf(dev, "Unable to allocate bus resource: memory\n");
@@ -1257,9 +1257,9 @@ ixgb_allocate_pci_resources(struct adapt
        adapter->hw.hw_addr = (uint8_t *) & adapter->osdep.mem_bus_space_handle;
 
        rid = 0x0;
-       adapter->res_interrupt = bus_alloc_resource(dev, SYS_RES_IRQ,
-                                                   &rid, 0, ~0, 1,
-                                                 RF_SHAREABLE | RF_ACTIVE);
+       adapter->res_interrupt = bus_alloc_resource_any(dev, SYS_RES_IRQ,
+                                                       &rid,
+                                                       RF_SHAREABLE | 
RF_ACTIVE);
        if (!(adapter->res_interrupt)) {
                device_printf(dev,
                    "Unable to allocate bus resource: interrupt\n");

Modified: head/sys/dev/lmc/if_lmc.c
==============================================================================
--- head/sys/dev/lmc/if_lmc.c   Fri Feb 19 02:03:14 2016        (r295789)
+++ head/sys/dev/lmc/if_lmc.c   Fri Feb 19 03:37:56 2016        (r295790)
@@ -4510,8 +4510,8 @@ fbsd_attach(device_t dev)
   sc->csr_res_id   = TLP_CBMA;
   sc->csr_res_type = SYS_RES_MEMORY;
 # endif
-  sc->csr_res = bus_alloc_resource(dev, sc->csr_res_type, &sc->csr_res_id,
-   0, ~0, 1, RF_ACTIVE);
+  sc->csr_res = bus_alloc_resource_any(dev, sc->csr_res_type, &sc->csr_res_id,
+   RF_ACTIVE);
   if (sc->csr_res == NULL)
     {
     printf("%s: bus_alloc_resource(csr) failed.\n", NAME_UNIT);
@@ -4522,8 +4522,8 @@ fbsd_attach(device_t dev)
 
   /* Allocate PCI interrupt resources for the card. */
   sc->irq_res_id = 0;
-  sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_res_id,
-   0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+  sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_res_id,
+   RF_ACTIVE | RF_SHAREABLE);
   if (sc->irq_res == NULL)
     {
     printf("%s: bus_alloc_resource(irq) failed.\n", NAME_UNIT);

Modified: head/sys/dev/mrsas/mrsas.c
==============================================================================
--- head/sys/dev/mrsas/mrsas.c  Fri Feb 19 02:03:14 2016        (r295789)
+++ head/sys/dev/mrsas/mrsas.c  Fri Feb 19 03:37:56 2016        (r295790)
@@ -833,8 +833,8 @@ mrsas_attach(device_t dev)
        bar = pci_read_config(dev, MRSAS_PCI_BAR1, 4);
 
        sc->reg_res_id = MRSAS_PCI_BAR1;/* BAR1 offset */
-       if ((sc->reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
-           &(sc->reg_res_id), 0, ~0, 1, RF_ACTIVE))
+       if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+           &(sc->reg_res_id), RF_ACTIVE))
            == NULL) {
                device_printf(dev, "Cannot allocate PCI registers\n");
                goto attach_fail;

Modified: head/sys/dev/mxge/if_mxge.c
==============================================================================
--- head/sys/dev/mxge/if_mxge.c Fri Feb 19 02:03:14 2016        (r295789)
+++ head/sys/dev/mxge/if_mxge.c Fri Feb 19 03:37:56 2016        (r295790)
@@ -4661,8 +4661,8 @@ mxge_add_single_irq(mxge_softc_t *sc)
                rid = 0;
                sc->legacy_irq = 1;
        }
-       sc->irq_res = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &rid, 0, ~0,
-                                        1, RF_SHAREABLE | RF_ACTIVE);
+       sc->irq_res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid,
+                                            RF_SHAREABLE | RF_ACTIVE);
        if (sc->irq_res == NULL) {
                device_printf(sc->dev, "could not alloc interrupt\n");
                return ENXIO;
@@ -4813,8 +4813,8 @@ mxge_attach(device_t dev)
        
        /* Map the board into the kernel */
        rid = PCIR_BARS;
-       sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0,
-                                        ~0, 1, RF_ACTIVE);
+       sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+                                            RF_ACTIVE);
        if (sc->mem_res == NULL) {
                device_printf(dev, "could not map memory\n");
                err = ENXIO;

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==============================================================================
--- head/sys/dev/nvme/nvme_ctrlr.c      Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/nvme/nvme_ctrlr.c      Fri Feb 19 03:37:56 2016        
(r295790)
@@ -52,8 +52,8 @@ nvme_ctrlr_allocate_bar(struct nvme_cont
 
        ctrlr->resource_id = PCIR_BAR(0);
 
-       ctrlr->resource = bus_alloc_resource(ctrlr->dev, SYS_RES_MEMORY,
-           &ctrlr->resource_id, 0, ~0, 1, RF_ACTIVE);
+       ctrlr->resource = bus_alloc_resource_any(ctrlr->dev, SYS_RES_MEMORY,
+           &ctrlr->resource_id, RF_ACTIVE);
 
        if(ctrlr->resource == NULL) {
                nvme_printf(ctrlr, "unable to allocate pci resource\n");
@@ -72,8 +72,8 @@ nvme_ctrlr_allocate_bar(struct nvme_cont
         *  bus_alloc_resource() will just return NULL which is OK.
         */
        ctrlr->bar4_resource_id = PCIR_BAR(4);
-       ctrlr->bar4_resource = bus_alloc_resource(ctrlr->dev, SYS_RES_MEMORY,
-           &ctrlr->bar4_resource_id, 0, ~0, 1, RF_ACTIVE);
+       ctrlr->bar4_resource = bus_alloc_resource_any(ctrlr->dev, 
SYS_RES_MEMORY,
+           &ctrlr->bar4_resource_id, RF_ACTIVE);
 
        return (0);
 }

Modified: head/sys/dev/quicc/quicc_core.c
==============================================================================
--- head/sys/dev/quicc/quicc_core.c     Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/quicc/quicc_core.c     Fri Feb 19 03:37:56 2016        
(r295790)
@@ -110,8 +110,8 @@ quicc_bfe_attach(device_t dev)
         * Re-allocate. We expect that the softc contains the information
         * collected by quicc_bfe_probe() intact.
         */
-       sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, &sc->sc_rrid,
-           0, ~0, 0, RF_ACTIVE);
+       sc->sc_rres = bus_alloc_resource_any(dev, sc->sc_rtype, &sc->sc_rrid,
+           RF_ACTIVE);
        if (sc->sc_rres == NULL)
                return (ENXIO);
 
@@ -228,13 +228,13 @@ quicc_bfe_probe(device_t dev, u_int cloc
 
        sc->sc_rrid = 0;
        sc->sc_rtype = SYS_RES_MEMORY;
-       sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, &sc->sc_rrid,
-           0, ~0, 0, RF_ACTIVE);
+       sc->sc_rres = bus_alloc_resource_any(dev, sc->sc_rtype, &sc->sc_rrid,
+           RF_ACTIVE);
        if (sc->sc_rres == NULL) {
                sc->sc_rrid = 0;
                sc->sc_rtype = SYS_RES_IOPORT;
-               sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype,
-                   &sc->sc_rrid, 0, ~0, 0, RF_ACTIVE);
+               sc->sc_rres = bus_alloc_resource_any(dev, sc->sc_rtype,
+                   &sc->sc_rrid, RF_ACTIVE);
                if (sc->sc_rres == NULL)
                        return (ENXIO);
        }

Modified: head/sys/dev/sound/pci/envy24.c
==============================================================================
--- head/sys/dev/sound/pci/envy24.c     Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/sound/pci/envy24.c     Fri Feb 19 03:37:56 2016        
(r295790)
@@ -2482,17 +2482,17 @@ envy24_alloc_resource(struct sc_info *sc
 {
        /* allocate I/O port resource */
        sc->csid = PCIR_CCS;
-       sc->cs = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
-           &sc->csid, 0, ~0, 1, RF_ACTIVE);
+       sc->cs = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT,
+           &sc->csid, RF_ACTIVE);
        sc->ddmaid = PCIR_DDMA;
-       sc->ddma = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
-           &sc->ddmaid, 0, ~0, 1, RF_ACTIVE);
+       sc->ddma = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT,
+           &sc->ddmaid, RF_ACTIVE);
        sc->dsid = PCIR_DS;
-       sc->ds = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
-           &sc->dsid, 0, ~0, 1, RF_ACTIVE);
+       sc->ds = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT,
+           &sc->dsid, RF_ACTIVE);
        sc->mtid = PCIR_MT;
-       sc->mt = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
-           &sc->mtid, 0, ~0, 1, RF_ACTIVE);
+       sc->mt = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT,
+           &sc->mtid, RF_ACTIVE);
        if (!sc->cs || !sc->ddma || !sc->ds || !sc->mt) {
                device_printf(sc->dev, "unable to map IO port space\n");
                return ENXIO;
@@ -2516,8 +2516,8 @@ envy24_alloc_resource(struct sc_info *sc
 
        /* allocate interrupt resource */
        sc->irqid = 0;
-       sc->irq = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irqid,
-                                0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+       sc->irq = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &sc->irqid,
+                                RF_ACTIVE | RF_SHAREABLE);
        if (!sc->irq ||
            snd_setup_intr(sc->dev, sc->irq, INTR_MPSAFE, envy24_intr, sc, 
&sc->ih)) {
                device_printf(sc->dev, "unable to map interrupt\n");

Modified: head/sys/dev/sound/pci/envy24ht.c
==============================================================================
--- head/sys/dev/sound/pci/envy24ht.c   Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/sound/pci/envy24ht.c   Fri Feb 19 03:37:56 2016        
(r295790)
@@ -2400,11 +2400,11 @@ envy24ht_alloc_resource(struct sc_info *
 {
        /* allocate I/O port resource */
        sc->csid = PCIR_CCS;
-       sc->cs = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
-           &sc->csid, 0, ~0, 1, RF_ACTIVE);
+       sc->cs = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT,
+           &sc->csid, RF_ACTIVE);
        sc->mtid = ENVY24HT_PCIR_MT;
-       sc->mt = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
-           &sc->mtid, 0, ~0, 1, RF_ACTIVE);
+       sc->mt = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT,
+           &sc->mtid, RF_ACTIVE);
        if (!sc->cs || !sc->mt) {
                device_printf(sc->dev, "unable to map IO port space\n");
                return ENXIO;
@@ -2422,8 +2422,8 @@ envy24ht_alloc_resource(struct sc_info *
 
        /* allocate interrupt resource */
        sc->irqid = 0;
-       sc->irq = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irqid,
-                                0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+       sc->irq = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &sc->irqid,
+                                RF_ACTIVE | RF_SHAREABLE);
        if (!sc->irq ||
            snd_setup_intr(sc->dev, sc->irq, INTR_MPSAFE, envy24ht_intr, sc, 
&sc->ih)) {
                device_printf(sc->dev, "unable to map interrupt\n");

Modified: head/sys/dev/sound/pci/hdspe.c
==============================================================================
--- head/sys/dev/sound/pci/hdspe.c      Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/sound/pci/hdspe.c      Fri Feb 19 03:37:56 2016        
(r295790)
@@ -128,8 +128,8 @@ hdspe_alloc_resources(struct sc_info *sc
 
        /* Allocate resource. */
        sc->csid = PCIR_BAR(0);
-       sc->cs = bus_alloc_resource(sc->dev, SYS_RES_MEMORY,
-           &sc->csid, 0, ~0, 1, RF_ACTIVE);
+       sc->cs = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY,
+           &sc->csid, RF_ACTIVE);
 
        if (!sc->cs) {
                device_printf(sc->dev, "Unable to map SYS_RES_MEMORY.\n");
@@ -141,8 +141,8 @@ hdspe_alloc_resources(struct sc_info *sc
 
        /* Allocate interrupt resource. */
        sc->irqid = 0;
-       sc->irq = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irqid,
-           0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+       sc->irq = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &sc->irqid,
+           RF_ACTIVE | RF_SHAREABLE);
 
        if (!sc->irq ||
            bus_setup_intr(sc->dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV,

Modified: head/sys/dev/sound/pci/vibes.c
==============================================================================
--- head/sys/dev/sound/pci/vibes.c      Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/sound/pci/vibes.c      Fri Feb 19 03:37:56 2016        
(r295790)
@@ -759,8 +759,8 @@ sv_attach(device_t dev) {
 
        /* Register IRQ handler */
        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, sv_intr, sc, &sc->ih)) {
                 device_printf(dev, "sv_attach: Unable to map interrupt\n");

Modified: head/sys/dev/twa/tw_osl_freebsd.c
==============================================================================
--- head/sys/dev/twa/tw_osl_freebsd.c   Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/dev/twa/tw_osl_freebsd.c   Fri Feb 19 03:37:56 2016        
(r295790)
@@ -338,8 +338,8 @@ twa_attach(device_t dev)
                return(error);
        }
        sc->reg_res_id = PCIR_BARS + bar0_offset;
-       if ((sc->reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
-                               &(sc->reg_res_id), 0, ~0, 1, RF_ACTIVE))
+       if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+                               &(sc->reg_res_id), RF_ACTIVE))
                                == NULL) {
                tw_osli_printf(sc, "error = %d",
                        TW_CL_SEVERITY_ERROR_STRING,
@@ -355,8 +355,8 @@ twa_attach(device_t dev)
 
        /* Allocate and register our interrupt. */
        sc->irq_res_id = 0;
-       if ((sc->irq_res = bus_alloc_resource(sc->bus_dev, SYS_RES_IRQ,
-                               &(sc->irq_res_id), 0, ~0, 1,
+       if ((sc->irq_res = bus_alloc_resource_any(sc->bus_dev, SYS_RES_IRQ,
+                               &(sc->irq_res_id),
                                RF_SHAREABLE | RF_ACTIVE)) == NULL) {
                tw_osli_printf(sc, "error = %d",
                        TW_CL_SEVERITY_ERROR_STRING,

Modified: head/sys/dev/tws/tws.c
==============================================================================
--- head/sys/dev/tws/tws.c      Fri Feb 19 02:03:14 2016        (r295789)
+++ head/sys/dev/tws/tws.c      Fri Feb 19 03:37:56 2016        (r295790)
@@ -245,8 +245,8 @@ tws_attach(device_t dev)
 
     /* allocate MMIO register space */ 
     sc->reg_res_id = TWS_PCI_BAR1; /* BAR1 offset */
-    if ((sc->reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
-                                &(sc->reg_res_id), 0, ~0, 1, RF_ACTIVE))
+    if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+                                &(sc->reg_res_id), RF_ACTIVE))
                                 == NULL) {
         tws_log(sc, ALLOC_MEMORY_RES);
         goto attach_fail_1;

Modified: head/sys/isa/isa_common.c
==============================================================================
--- head/sys/isa/isa_common.c   Fri Feb 19 02:03:14 2016        (r295789)
+++ head/sys/isa/isa_common.c   Fri Feb 19 03:37:56 2016        (r295790)
@@ -150,8 +150,8 @@ isa_find_memory(device_t child, struct i
                     start += MAX(align, 1)) {
                        bus_set_resource(child, SYS_RES_MEMORY, i,
                                         start, size);
-                       res[i] = bus_alloc_resource(child,
-                           SYS_RES_MEMORY, &i, 0, ~0, 1,
+                       res[i] = bus_alloc_resource_any(child,
+                           SYS_RES_MEMORY, &i,
                            rman_make_alignment_flags(align) /* !RF_ACTIVE */);
                        if (res[i]) {
                                result->ic_mem[i].ir_start = start;
@@ -224,8 +224,8 @@ isa_find_port(device_t child, struct isa
                     start += align) {
                        bus_set_resource(child, SYS_RES_IOPORT, i,
                                         start, size);
-                       res[i] = bus_alloc_resource(child,
-                           SYS_RES_IOPORT, &i, 0, ~0, 1,
+                       res[i] = bus_alloc_resource_any(child,
+                           SYS_RES_IOPORT, &i,
                            rman_make_alignment_flags(align) /* !RF_ACTIVE */);
                        if (res[i]) {
                                result->ic_port[i].ir_start = start;

Modified: head/sys/isa/vga_isa.c
==============================================================================
--- head/sys/isa/vga_isa.c      Fri Feb 19 02:03:14 2016        (r295789)
+++ head/sys/isa/vga_isa.c      Fri Feb 19 03:37:56 2016        (r295790)
@@ -195,11 +195,11 @@ isavga_attach(device_t dev)
        sc = device_get_softc(dev);
 
        rid = 0;
-       bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
-                                 0, ~0, 0, RF_ACTIVE | RF_SHAREABLE);
+       bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,
+                                 RF_ACTIVE | RF_SHAREABLE);
        rid = 0;
-       bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
-                                0, ~0, 0, RF_ACTIVE | RF_SHAREABLE);
+       bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+                                RF_ACTIVE | RF_SHAREABLE);
 
        error = vga_attach_unit(unit, sc, device_get_flags(dev));
        if (error)

Modified: head/sys/mips/sibyte/ata_zbbus.c
==============================================================================
--- head/sys/mips/sibyte/ata_zbbus.c    Fri Feb 19 02:03:14 2016        
(r295789)
+++ head/sys/mips/sibyte/ata_zbbus.c    Fri Feb 19 03:37:56 2016        
(r295790)
@@ -67,7 +67,7 @@ ata_zbbus_attach(device_t dev)
        ch->attached = 1;
 
        rid = 0;
-       io = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, RF_ACTIVE);
+       io = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
        if (io == NULL)
                return (ENXIO);
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to