Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jan 2011 20:36:20 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r217909 - in stable/7/sys/dev: if_ndis mpt
Message-ID:  <201101262036.p0QKaKf1089435@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Jan 26 20:36:20 2011
New Revision: 217909
URL: http://svn.freebsd.org/changeset/base/217909

Log:
  MFC 216486,216764:
  Use bus_alloc_resource_any() instead of bus_alloc_resource().

Modified:
  stable/7/sys/dev/if_ndis/if_ndis_pccard.c
  stable/7/sys/dev/if_ndis/if_ndis_pci.c
  stable/7/sys/dev/mpt/mpt_pci.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/if_ndis/if_ndis_pccard.c
==============================================================================
--- stable/7/sys/dev/if_ndis/if_ndis_pccard.c	Wed Jan 26 20:36:04 2011	(r217908)
+++ stable/7/sys/dev/if_ndis/if_ndis_pccard.c	Wed Jan 26 20:36:20 2011	(r217909)
@@ -195,9 +195,8 @@ ndis_attach_pccard(dev)
 	resource_list_init(&sc->ndis_rl);
 
 	sc->ndis_io_rid = 0;
-	sc->ndis_res_io = bus_alloc_resource(dev,
-	    SYS_RES_IOPORT, &sc->ndis_io_rid,
-	    0, ~0, 1, RF_ACTIVE);
+	sc->ndis_res_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
+	    &sc->ndis_io_rid, RF_ACTIVE);
 	if (sc->ndis_res_io == NULL) {
 		device_printf(dev,
 		    "couldn't map iospace\n");
@@ -210,8 +209,7 @@ ndis_attach_pccard(dev)
 	    rman_get_size(sc->ndis_res_io));
 
 	rid = 0;
-	sc->ndis_irq = bus_alloc_resource(dev,
-	    SYS_RES_IRQ, &rid, 0, ~0, 1,
+	sc->ndis_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
 	    RF_SHAREABLE | RF_ACTIVE);
 	if (sc->ndis_irq == NULL) {
 		device_printf(dev,

Modified: stable/7/sys/dev/if_ndis/if_ndis_pci.c
==============================================================================
--- stable/7/sys/dev/if_ndis/if_ndis_pci.c	Wed Jan 26 20:36:04 2011	(r217908)
+++ stable/7/sys/dev/if_ndis/if_ndis_pci.c	Wed Jan 26 20:36:20 2011	(r217909)
@@ -195,9 +195,9 @@ ndis_attach_pci(dev)
 			switch (rle->type) {
 			case SYS_RES_IOPORT:
 				sc->ndis_io_rid = rle->rid;
-				sc->ndis_res_io = bus_alloc_resource(dev,
+				sc->ndis_res_io = bus_alloc_resource_any(dev,
 				    SYS_RES_IOPORT, &sc->ndis_io_rid,
-				    0, ~0, 1, RF_ACTIVE);
+				    RF_ACTIVE);
 				if (sc->ndis_res_io == NULL) {
 					device_printf(dev,
 					    "couldn't map iospace\n");
@@ -217,10 +217,10 @@ ndis_attach_pci(dev)
 				if (sc->ndis_res_mem) {
 					sc->ndis_altmem_rid = rle->rid;
 					sc->ndis_res_altmem =
-					    bus_alloc_resource(dev,
+					    bus_alloc_resource_any(dev,
 					        SYS_RES_MEMORY,
 						&sc->ndis_altmem_rid,
-						0, ~0, 1, RF_ACTIVE);
+						RF_ACTIVE);
 					if (sc->ndis_res_altmem == NULL) {
 						device_printf(dev,
 						    "couldn't map alt "
@@ -231,10 +231,10 @@ ndis_attach_pci(dev)
 				} else {
 					sc->ndis_mem_rid = rle->rid;
 					sc->ndis_res_mem =
-					    bus_alloc_resource(dev,
+					    bus_alloc_resource_any(dev,
 					        SYS_RES_MEMORY,
 						&sc->ndis_mem_rid,
-						0, ~0, 1, RF_ACTIVE);
+						RF_ACTIVE);
 					if (sc->ndis_res_mem == NULL) {
 						device_printf(dev,
 						    "couldn't map memory\n");
@@ -246,9 +246,9 @@ ndis_attach_pci(dev)
 				break;
 			case SYS_RES_IRQ:
 				rid = rle->rid;
-				sc->ndis_irq = bus_alloc_resource(dev,
-				    SYS_RES_IRQ, &rid, 0, ~0, 1,
-	    			    RF_SHAREABLE | RF_ACTIVE);
+				sc->ndis_irq = bus_alloc_resource_any(dev,
+				    SYS_RES_IRQ, &rid,
+				    RF_SHAREABLE | RF_ACTIVE);
 				if (sc->ndis_irq == NULL) {
 					device_printf(dev,
 					    "couldn't map interrupt\n");
@@ -273,8 +273,8 @@ ndis_attach_pci(dev)
 	 */
 	if (sc->ndis_irq == NULL) {
 		rid = 0;
-		sc->ndis_irq = bus_alloc_resource(dev, SYS_RES_IRQ,
-		    &rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE);
+		sc->ndis_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
+		    &rid, RF_SHAREABLE | RF_ACTIVE);
 		if (sc->ndis_irq == NULL) {
 			device_printf(dev, "couldn't route interrupt\n");
 			error = ENXIO;

Modified: stable/7/sys/dev/mpt/mpt_pci.c
==============================================================================
--- stable/7/sys/dev/mpt/mpt_pci.c	Wed Jan 26 20:36:04 2011	(r217908)
+++ stable/7/sys/dev/mpt/mpt_pci.c	Wed Jan 26 20:36:20 2011	(r217909)
@@ -510,8 +510,8 @@ mpt_pci_attach(device_t dev)
 	 * some cards otherwise).
 	 */
 	mpt->pci_pio_rid = PCIR_BAR(MPT_IO_BAR);
-	mpt->pci_pio_reg = bus_alloc_resource(dev, SYS_RES_IOPORT,
-			    &mpt->pci_pio_rid, 0, ~0, 0, RF_ACTIVE);
+	mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
+			    &mpt->pci_pio_rid, RF_ACTIVE);
 	if (mpt->pci_pio_reg == NULL) {
 		device_printf(dev, "unable to map registers in PIO mode\n");
 		goto bad;
@@ -521,8 +521,8 @@ mpt_pci_attach(device_t dev)
 
 	/* Allocate kernel virtual memory for the 9x9's Mem0 region */
 	mpt->pci_mem_rid = PCIR_BAR(MPT_MEM_BAR);
-	mpt->pci_reg = bus_alloc_resource(dev, SYS_RES_MEMORY,
-			&mpt->pci_mem_rid, 0, ~0, 0, RF_ACTIVE);
+	mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+			&mpt->pci_mem_rid, RF_ACTIVE);
 	if (mpt->pci_reg == NULL) {
 		device_printf(dev, "Unable to memory map registers.\n");
 		if (mpt->is_sas) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101262036.p0QKaKf1089435>