From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 15:19:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B5B11065674; Thu, 16 Dec 2010 15:19:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7999C8FC16; Thu, 16 Dec 2010 15:19:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGFJWME063817; Thu, 16 Dec 2010 15:19:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGFJWC8063814; Thu, 16 Dec 2010 15:19:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012161519.oBGFJWC8063814@svn.freebsd.org> From: John Baldwin Date: Thu, 16 Dec 2010 15:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216486 - head/sys/dev/if_ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 15:19:32 -0000 Author: jhb Date: Thu Dec 16 15:19:32 2010 New Revision: 216486 URL: http://svn.freebsd.org/changeset/base/216486 Log: Use bus_alloc_resource_any() instead of bus_alloc_resource(). Besides being cleaner, this fixes problems where the code was using ~0 instead of ~0ul for the upper bound on "any" resources. MFC after: 1 month Modified: head/sys/dev/if_ndis/if_ndis_pccard.c head/sys/dev/if_ndis/if_ndis_pci.c Modified: head/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pccard.c Thu Dec 16 15:18:53 2010 (r216485) +++ head/sys/dev/if_ndis/if_ndis_pccard.c Thu Dec 16 15:19:32 2010 (r216486) @@ -198,9 +198,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"); @@ -213,8 +212,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: head/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pci.c Thu Dec 16 15:18:53 2010 (r216485) +++ head/sys/dev/if_ndis/if_ndis_pci.c Thu Dec 16 15:19:32 2010 (r216486) @@ -192,9 +192,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"); @@ -214,10 +214,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 " @@ -228,10 +228,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"); @@ -243,9 +243,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"); @@ -270,8 +270,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;