bus_alloc_resource -> bus_alloc_resource_any
authorPeter Avalos <pavalos@dragonflybsd.org>
Fri, 6 Jul 2007 01:11:07 +0000 (01:11 +0000)
committerPeter Avalos <pavalos@dragonflybsd.org>
Fri, 6 Jul 2007 01:11:07 +0000 (01:11 +0000)
Obtained-from: FreeBSD

sys/dev/disk/aic7xxx/ahc_eisa.c
sys/dev/disk/aic7xxx/ahc_pci.c
sys/dev/disk/aic7xxx/ahd_pci.c

index 482d21e..d23ae95 100644 (file)
@@ -28,8 +28,8 @@
  *
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/ahc_eisa.c#13 $
  *
- * $FreeBSD: src/sys/dev/aic7xxx/ahc_eisa.c,v 1.32 2003/12/17 00:02:09 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/ahc_eisa.c,v 1.7 2007/07/06 00:01:16 pavalos Exp $
+ * $FreeBSD: src/sys/dev/aic7xxx/ahc_eisa.c,v 1.33 2004/03/17 17:50:25 njl Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/ahc_eisa.c,v 1.8 2007/07/06 01:11:07 pavalos Exp $
  */
 
 #include "aic7xxx_osm.h"
@@ -61,8 +61,7 @@ aic7770_probe(device_t dev)
        eisa_add_iospace(dev, iobase, AHC_EISA_IOSIZE, RESVADDR_NONE);
 
        rid = 0;
-       regs = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
-                               0, ~0, 1, RF_ACTIVE);
+       regs = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
        if (regs == NULL) {
                device_printf(dev, "Unable to map I/O space?!\n");
                return ENOMEM;
@@ -165,8 +164,8 @@ aic7770_map_registers(struct ahc_softc *ahc, u_int unused_ioport_arg)
        int     rid;
 
        rid = 0;
-       regs = bus_alloc_resource(ahc->dev_softc, SYS_RES_IOPORT,
-                                 &rid, 0, ~0, 1, RF_ACTIVE);
+       regs = bus_alloc_resource_any(ahc->dev_softc, SYS_RES_IOPORT, &rid,
+                                     RF_ACTIVE);
        if (regs == NULL) {
                device_printf(ahc->dev_softc, "Unable to map I/O space?!\n");
                return ENOMEM;
@@ -186,8 +185,8 @@ aic7770_map_int(struct ahc_softc *ahc, int irq)
 
        zero = 0;
        ahc->platform_data->irq =
-           bus_alloc_resource(ahc->dev_softc, SYS_RES_IRQ, &zero,
-                              0, ~0, 1, RF_ACTIVE);
+           bus_alloc_resource_any(ahc->dev_softc, SYS_RES_IRQ, &zero,
+                                  RF_ACTIVE);
        if (ahc->platform_data->irq == NULL)
                return (ENOMEM);
        ahc->platform_data->irq_res_type = SYS_RES_IRQ;
index f244f76..b7d8320 100644 (file)
@@ -30,8 +30,8 @@
  *
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/ahc_pci.c#19 $
  *
- * $FreeBSD: src/sys/dev/aic7xxx/ahc_pci.c,v 1.60 2003/12/17 00:02:09 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/ahc_pci.c,v 1.10 2007/07/06 00:01:16 pavalos Exp $
+ * $FreeBSD: src/sys/dev/aic7xxx/ahc_pci.c,v 1.61 2004/03/17 17:50:25 njl Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/ahc_pci.c,v 1.11 2007/07/06 01:11:07 pavalos Exp $
  */
 
 #include "aic7xxx_osm.h"
@@ -172,8 +172,8 @@ ahc_pci_map_registers(struct ahc_softc *ahc)
 
                regs_type = SYS_RES_MEMORY;
                regs_id = AHC_PCI_MEMADDR;
-               regs = bus_alloc_resource(ahc->dev_softc, regs_type,
-                                         &regs_id, 0, ~0, 1, RF_ACTIVE);
+               regs = bus_alloc_resource_any(ahc->dev_softc, regs_type,
+                                             &regs_id, RF_ACTIVE);
                if (regs != NULL) {
                        ahc->tag = rman_get_bustag(regs);
                        ahc->bsh = rman_get_bushandle(regs);
@@ -204,8 +204,8 @@ ahc_pci_map_registers(struct ahc_softc *ahc)
        if (regs == NULL && (command & PCIM_CMD_PORTEN) != 0) {
                regs_type = SYS_RES_IOPORT;
                regs_id = AHC_PCI_IOADDR;
-               regs = bus_alloc_resource(ahc->dev_softc, regs_type,
-                                         &regs_id, 0, ~0, 1, RF_ACTIVE);
+               regs = bus_alloc_resource_any(ahc->dev_softc, regs_type,
+                                             &regs_id, RF_ACTIVE);
                if (regs != NULL) {
                        ahc->tag = rman_get_bustag(regs);
                        ahc->bsh = rman_get_bushandle(regs);
@@ -245,8 +245,8 @@ ahc_pci_map_int(struct ahc_softc *ahc)
 
        zero = 0;
        ahc->platform_data->irq =
-           bus_alloc_resource(ahc->dev_softc, SYS_RES_IRQ, &zero,
-                              0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+           bus_alloc_resource_any(ahc->dev_softc, SYS_RES_IRQ, &zero,
+                                  RF_ACTIVE | RF_SHAREABLE);
        if (ahc->platform_data->irq == NULL) {
                device_printf(ahc->dev_softc,
                              "bus_alloc_resource() failed to allocate IRQ\n");
index d0b8565..8a9a877 100644 (file)
@@ -30,8 +30,8 @@
  *
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/ahd_pci.c#17 $
  *
- * $FreeBSD: src/sys/dev/aic7xxx/ahd_pci.c,v 1.15 2003/12/17 00:02:09 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/ahd_pci.c,v 1.9 2007/07/06 00:01:16 pavalos Exp $
+ * $FreeBSD: src/sys/dev/aic7xxx/ahd_pci.c,v 1.16 2004/03/17 17:50:25 njl Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/ahd_pci.c,v 1.10 2007/07/06 01:11:07 pavalos Exp $
  */
 
 #include "aic79xx_osm.h"
@@ -169,8 +169,8 @@ ahd_pci_map_registers(struct ahd_softc *ahd)
 
                regs_type = SYS_RES_MEMORY;
                regs_id = AHD_PCI_MEMADDR;
-               regs = bus_alloc_resource(ahd->dev_softc, regs_type,
-                                         &regs_id, 0, ~0, 1, RF_ACTIVE);
+               regs = bus_alloc_resource_any(ahd->dev_softc, regs_type,
+                                             &regs_id, RF_ACTIVE);
                if (regs != NULL) {
                        int error;
 
@@ -207,8 +207,8 @@ ahd_pci_map_registers(struct ahd_softc *ahd)
        if (regs == NULL && (command & PCIM_CMD_PORTEN) != 0) {
                regs_type = SYS_RES_IOPORT;
                regs_id = AHD_PCI_IOADDR0;
-               regs = bus_alloc_resource(ahd->dev_softc, regs_type,
-                                         &regs_id, 0, ~0, 1, RF_ACTIVE);
+               regs = bus_alloc_resource_any(ahd->dev_softc, regs_type,
+                                             &regs_id, RF_ACTIVE);
                if (regs == NULL) {
                        device_printf(ahd->dev_softc,
                                      "can't allocate register resources\n");
@@ -219,8 +219,8 @@ ahd_pci_map_registers(struct ahd_softc *ahd)
 
                /* And now the second BAR */
                regs_id2 = AHD_PCI_IOADDR1;
-               regs2 = bus_alloc_resource(ahd->dev_softc, regs_type,
-                                          &regs_id2, 0, ~0, 1, RF_ACTIVE);
+               regs2 = bus_alloc_resource_any(ahd->dev_softc, regs_type,
+                                              &regs_id2, RF_ACTIVE);
                if (regs2 == NULL) {
                        device_printf(ahd->dev_softc,
                                      "can't allocate register resources\n");
@@ -248,8 +248,8 @@ ahd_pci_map_int(struct ahd_softc *ahd)
 
        zero = 0;
        ahd->platform_data->irq =
-           bus_alloc_resource(ahd->dev_softc, SYS_RES_IRQ, &zero,
-                              0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+           bus_alloc_resource_any(ahd->dev_softc, SYS_RES_IRQ, &zero,
+                                  RF_ACTIVE | RF_SHAREABLE);
        if (ahd->platform_data->irq == NULL)
                return (ENOMEM);
        ahd->platform_data->irq_res_type = SYS_RES_IRQ;