]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[pci] Update drivers to use pci_ioremap()
authorMichael Brown <mcb30@ipxe.org>
Thu, 24 Sep 2020 20:45:03 +0000 (21:45 +0100)
committerMichael Brown <mcb30@ipxe.org>
Fri, 25 Sep 2020 13:17:07 +0000 (14:17 +0100)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
47 files changed:
src/arch/x86/drivers/xen/hvm.c
src/arch/x86/drivers/xen/hvm.h
src/drivers/bus/pcimsix.c
src/drivers/bus/virtio-pci.c
src/drivers/infiniband/arbel.c
src/drivers/infiniband/flexboot_nodnic.c
src/drivers/infiniband/golan.c
src/drivers/infiniband/hermon.c
src/drivers/infiniband/linda.c
src/drivers/infiniband/mlx_utils_flexboot/src/mlx_pci_priv.c
src/drivers/infiniband/qib7322.c
src/drivers/net/amd8111e.c
src/drivers/net/ath/ath5k/ath5k.c
src/drivers/net/ath/ath9k/ath9k.c
src/drivers/net/b44.c
src/drivers/net/bnx2.c
src/drivers/net/bnxt/bnxt.c
src/drivers/net/ena.c
src/drivers/net/etherfabric.c
src/drivers/net/exanic.c
src/drivers/net/forcedeth.c
src/drivers/net/icplus.c
src/drivers/net/igbvf/igbvf_main.c
src/drivers/net/intel.c
src/drivers/net/intelx.c
src/drivers/net/intelxl.c
src/drivers/net/intelxlvf.c
src/drivers/net/intelxvf.c
src/drivers/net/jme.c
src/drivers/net/myson.c
src/drivers/net/natsemi.c
src/drivers/net/phantom/phantom.c
src/drivers/net/prism2_pci.c
src/drivers/net/realtek.c
src/drivers/net/rhine.c
src/drivers/net/sfc/efx_common.c
src/drivers/net/sis190.c
src/drivers/net/skeleton.c
src/drivers/net/skge.c
src/drivers/net/sky2.c
src/drivers/net/tg3/tg3.c
src/drivers/net/thunderx.c
src/drivers/net/velocity.c
src/drivers/net/vmxnet3.c
src/drivers/net/vxge/vxge_main.c
src/drivers/usb/ehci.c
src/drivers/usb/xhci.c

index 57196f5553d26017aa6c33e6345d1abf875f98c8..311f343ca5a303c11a229817a9bef7eb848e3212 100644 (file)
@@ -175,7 +175,7 @@ static void * hvm_ioremap ( struct hvm_device *hvm, unsigned int space,
        }
 
        /* Map this space */
-       mmio = ioremap ( ( hvm->mmio + hvm->mmio_offset ), len );
+       mmio = pci_ioremap ( hvm->pci, ( hvm->mmio + hvm->mmio_offset ), len );
        if ( ! mmio ) {
                DBGC ( hvm, "HVM could not map MMIO space [%08lx,%08lx)\n",
                       ( hvm->mmio + hvm->mmio_offset ),
@@ -371,7 +371,8 @@ static int hvm_map_xenstore ( struct hvm_device *hvm ) {
        xenstore_phys = ( xenstore_pfn * PAGE_SIZE );
 
        /* Map XenStore */
-       hvm->xen.store.intf = ioremap ( xenstore_phys, PAGE_SIZE );
+       hvm->xen.store.intf = pci_ioremap ( hvm->pci, xenstore_phys,
+                                           PAGE_SIZE );
        if ( ! hvm->xen.store.intf ) {
                DBGC ( hvm, "HVM could not map XenStore at [%08lx,%08lx)\n",
                       xenstore_phys, ( xenstore_phys + PAGE_SIZE ) );
@@ -420,6 +421,7 @@ static int hvm_probe ( struct pci_device *pci ) {
                rc = -ENOMEM;
                goto err_alloc;
        }
+       hvm->pci = pci;
        hvm->mmio = pci_bar_start ( pci, HVM_MMIO_BAR );
        hvm->mmio_len = pci_bar_size ( pci, HVM_MMIO_BAR );
        DBGC2 ( hvm, "HVM has MMIO space [%08lx,%08lx)\n",
index 72ed94f6d094d2b1981bbf456f239cebb140b1bf..88e4908154682a00e70ace4598f665a451024330 100644 (file)
@@ -39,6 +39,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 struct hvm_device {
        /** Xen hypervisor */
        struct xen_hypervisor xen;
+       /** PCI device */
+       struct pci_device *pci;
        /** CPUID base */
        uint32_t cpuid_base;
        /** Length of hypercall table */
index 80893c4186bb54bb4765b0a723982fd3310c3fb7..eb0450d91746dc8c550245b4e16f5e4542fe2b8a 100644 (file)
@@ -84,7 +84,7 @@ static void * pci_msix_ioremap ( struct pci_device *pci, struct pci_msix *msix,
               msix, pci_msix_name ( cfg ), base, bar, offset );
 
        /* Map BAR portion */
-       io = ioremap ( ( start + offset ), PCI_MSIX_LEN );
+       io = pci_ioremap ( pci, ( start + offset ), PCI_MSIX_LEN );
        if ( ! io ) {
                DBGC ( msix, "MSI-X %p %s could not map %#08lx\n",
                       msix, pci_msix_name ( cfg ), base );
index 402bf4f12a044b72c6e29c002d30edee2d1f3153..5d2d627508157a7c702c86f13111da753760a91f 100644 (file)
@@ -321,7 +321,7 @@ int virtio_pci_map_capability(struct pci_device *pci, int cap, size_t minlen,
             region->flags = VIRTIO_PCI_REGION_PORT;
         } else {
             /* Region mapped into memory space */
-            region->base = ioremap(base + offset, length);
+            region->base = pci_ioremap(pci, base + offset, length);
             region->flags = VIRTIO_PCI_REGION_MEMORY;
         }
     }
index 98a2b6010e3485096509de0d6ac47c37739e723b..eb7911aa439bcb3fa229e30ee7b13e787028d356 100644 (file)
@@ -2059,7 +2059,8 @@ static int arbel_start_firmware ( struct arbel *arbel ) {
        eq_set_ci_base_addr =
                ( ( (uint64_t) MLX_GET ( &fw, eq_set_ci_base_addr_h ) << 32 ) |
                  ( (uint64_t) MLX_GET ( &fw, eq_set_ci_base_addr_l ) ) );
-       arbel->eq_ci_doorbells = ioremap ( eq_set_ci_base_addr, 0x200 );
+       arbel->eq_ci_doorbells = pci_ioremap ( arbel->pci, eq_set_ci_base_addr,
+                                              0x200 );
 
        /* Enable locally-attached memory.  Ignore failure; there may
         * be no attached memory.
@@ -3025,6 +3026,8 @@ static void arbel_free ( struct arbel *arbel ) {
 static int arbel_probe ( struct pci_device *pci ) {
        struct arbel *arbel;
        struct ib_device *ibdev;
+       unsigned long config;
+       unsigned long uar;
        int i;
        int rc;
 
@@ -3041,11 +3044,11 @@ static int arbel_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map PCI BARs */
-       arbel->config = ioremap ( pci_bar_start ( pci, ARBEL_PCI_CONFIG_BAR ),
-                                 ARBEL_PCI_CONFIG_BAR_SIZE );
-       arbel->uar = ioremap ( ( pci_bar_start ( pci, ARBEL_PCI_UAR_BAR ) +
-                                ARBEL_PCI_UAR_IDX * ARBEL_PCI_UAR_SIZE ),
-                              ARBEL_PCI_UAR_SIZE );
+       config = pci_bar_start ( pci, ARBEL_PCI_CONFIG_BAR );
+       arbel->config = pci_ioremap ( pci, config, ARBEL_PCI_CONFIG_BAR_SIZE );
+       uar = ( pci_bar_start ( pci, ARBEL_PCI_UAR_BAR ) +
+               ARBEL_PCI_UAR_IDX * ARBEL_PCI_UAR_SIZE );
+       arbel->uar = pci_ioremap ( pci, uar, ARBEL_PCI_UAR_SIZE );
 
        /* Allocate Infiniband devices */
        for ( i = 0 ; i < ARBEL_NUM_PORTS ; i++ ) {
index 7d039fffc30556505e301b440640b46be77f6634..54b8584060202cdff183c782caa5494bda4709a4 100644 (file)
@@ -1461,7 +1461,7 @@ static int flexboot_nodnic_alloc_uar ( struct flexboot_nodnic *flexboot_nodnic )
                return -EINVAL;
        }
        uar->phys = ( pci_bar_start ( pci, FLEXBOOT_NODNIC_HCA_BAR ) + (mlx_uint32)uar->offset );
-       uar->virt = ( void * )( ioremap ( uar->phys, FLEXBOOT_NODNIC_PAGE_SIZE ) );
+       uar->virt = ( void * )( pci_ioremap ( pci, uar->phys, FLEXBOOT_NODNIC_PAGE_SIZE ) );
 
        return status;
 }
index e96ba2698a56bf73e87d02395eeb4bde63e58d7c..7ab4a4ee6d06c6e59f15045849099045bc045790 100755 (executable)
@@ -693,7 +693,7 @@ static inline int golan_alloc_uar(struct golan *golan)
        uar->index      = be32_to_cpu(out->uarn) & 0xffffff;
 
        uar->phys = (pci_bar_start(golan->pci, GOLAN_HCA_BAR) + (uar->index << GOLAN_PAGE_SHIFT));
-       uar->virt = (void *)(ioremap(uar->phys, GOLAN_PAGE_SIZE));
+       uar->virt = (void *)(pci_ioremap(golan->pci, uar->phys, GOLAN_PAGE_SIZE));
 
        DBGC( golan , "%s: UAR allocated with index 0x%x\n", __FUNCTION__, uar->index);
        return 0;
@@ -922,8 +922,8 @@ static inline void golan_pci_init(struct golan *golan)
        adjust_pci_device ( pci );
 
        /* Get HCA BAR */
-       golan->iseg     = ioremap ( pci_bar_start ( pci, GOLAN_HCA_BAR),
-                                       GOLAN_PCI_CONFIG_BAR_SIZE );
+       golan->iseg = pci_ioremap ( pci, pci_bar_start ( pci, GOLAN_HCA_BAR),
+                                   GOLAN_PCI_CONFIG_BAR_SIZE );
 }
 
 static inline struct golan *golan_alloc()
index 9675c156b666f82507b238963b4a17a957a1d7b5..b6599588ff327e410586400ddaa20c7bdd1b6049 100644 (file)
@@ -3782,6 +3782,8 @@ static int hermon_probe ( struct pci_device *pci ) {
        struct ib_device *ibdev;
        struct net_device *netdev;
        struct hermon_port *port;
+       unsigned long config;
+       unsigned long uar;
        unsigned int i;
        int rc;
 
@@ -3798,10 +3800,12 @@ static int hermon_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map PCI BARs */
-       hermon->config = ioremap ( pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR ),
-                                  HERMON_PCI_CONFIG_BAR_SIZE );
-       hermon->uar = ioremap ( pci_bar_start ( pci, HERMON_PCI_UAR_BAR ),
-                               HERMON_UAR_NON_EQ_PAGE * HERMON_PAGE_SIZE );
+       config = pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR );
+       hermon->config = pci_ioremap ( pci, config,
+                                      HERMON_PCI_CONFIG_BAR_SIZE );
+       uar = pci_bar_start ( pci, HERMON_PCI_UAR_BAR );
+       hermon->uar = pci_ioremap ( pci, uar,
+                                   HERMON_UAR_NON_EQ_PAGE * HERMON_PAGE_SIZE );
 
        /* Reset device */
        hermon_reset ( hermon );
@@ -3937,6 +3941,7 @@ static void hermon_remove ( struct pci_device *pci ) {
  */
 static int hermon_bofm_probe ( struct pci_device *pci ) {
        struct hermon *hermon;
+       unsigned long config;
        int rc;
 
        /* Allocate Hermon device */
@@ -3952,8 +3957,9 @@ static int hermon_bofm_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map PCI BAR */
-       hermon->config = ioremap ( pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR ),
-                                  HERMON_PCI_CONFIG_BAR_SIZE );
+       config = pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR );
+       hermon->config = pci_ioremap ( pci, config,
+                                      HERMON_PCI_CONFIG_BAR_SIZE );
 
        /* Initialise BOFM device */
        bofm_init ( &hermon->bofm, pci, &hermon_bofm_operations );
index e8d61c8655900401d15dde035ad3bc5d752e4714..8c2c090bc391a4d7e40369e27be53a442db35d13 100644 (file)
@@ -2335,7 +2335,7 @@ static int linda_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map PCI BARs */
-       linda->regs = ioremap ( pci->membase, LINDA_BAR0_SIZE );
+       linda->regs = pci_ioremap ( pci, pci->membase, LINDA_BAR0_SIZE );
        DBGC2 ( linda, "Linda %p has BAR at %08lx\n", linda, pci->membase );
 
        /* Print some general data */
index b474a4a634ac20b693b9b3815ea03601f6c630ba..6b42bcafc461b988946356143853328680798e78 100644 (file)
@@ -115,7 +115,7 @@ mlx_pci_init_priv(
        mlx_status status = MLX_SUCCESS;
        adjust_pci_device ( utils->pci );
 #ifdef DEVICE_CX3
-       utils->config = ioremap ( pci_bar_start ( utils->pci, PCI_BASE_ADDRESS_0),
+       utils->config = pci_ioremap ( utils->pci, pci_bar_start ( utils->pci, PCI_BASE_ADDRESS_0),
                        0x100000 );
 #endif
        return status;
index 18011c19a9683fe46980f1e8532f22f26a941396..a5606dd0355a2fed89d9897e458dade7f1fef21d 100644 (file)
@@ -2297,7 +2297,7 @@ static int qib7322_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map PCI BARs */
-       qib7322->regs = ioremap ( pci->membase, QIB7322_BAR0_SIZE );
+       qib7322->regs = pci_ioremap ( pci, pci->membase, QIB7322_BAR0_SIZE );
        DBGC2 ( qib7322, "QIB7322 %p has BAR at %08lx\n",
                qib7322, pci->membase );
 
index 693d77d1dbe3209a835e9241d9f3f301fa76c2ee..babd12d3c8a10e4f66d2d946a754b9e013bff8df 100644 (file)
@@ -664,7 +664,7 @@ static int amd8111e_probe(struct nic *nic, struct pci_device *pdev)
        memset(lp, 0, sizeof(*lp));
        lp->pdev = pdev;
        lp->nic = nic;
-       lp->mmio = ioremap(mmio_start, mmio_len);
+       lp->mmio = pci_ioremap(pdev, mmio_start, mmio_len);
        lp->opened = 1;
        adjust_pci_device(pdev);
 
index a500175a7c027aee37f9eb8c07a16d016e1ceea7..d8c47909dedb1dd9ca840e0339b0b8d102c551ef 100644 (file)
@@ -280,7 +280,7 @@ static int ath5k_probe(struct pci_device *pdev)
         */
        pci_write_config_byte(pdev, 0x41, 0);
 
-       mem = ioremap(pdev->membase, 0x10000);
+       mem = pci_ioremap(pdev, pdev->membase, 0x10000);
        if (!mem) {
                DBG("ath5k: cannot remap PCI memory region\n");
                ret = -EIO;
index 183aa65f681e538e23ab1e19e4788551dbcf4bff..98b7ecd5a44f40c9ce84741a903360c9ff72317e 100644 (file)
@@ -138,7 +138,7 @@ static int ath_pci_probe(struct pci_device *pdev)
        if ((val & 0x0000ff00) != 0)
                pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
 
-       mem = ioremap(pdev->membase, 0x10000);
+       mem = pci_ioremap(pdev, pdev->membase, 0x10000);
        if (!mem) {
                DBG("ath9K: PCI memory map error\n") ;
                ret = -EIO;
index d9aeb1b4bae05bd0dee5d52f8efb22c650e22fde..e0e6f4642ead5d739537df97e95479ff61eb2164 100644 (file)
@@ -673,7 +673,7 @@ static int b44_probe(struct pci_device *pci)
        bp->pci = pci;
 
        /* Map device registers */
-       bp->regs = ioremap(pci->membase, B44_REGS_SIZE);
+       bp->regs = pci_ioremap(pci, pci->membase, B44_REGS_SIZE);
        if (!bp->regs) {
                netdev_put(netdev);
                return -ENOMEM;
index 4ebcc52a96a4737b0d2d283a9ecdbd0ccc5adffb..d5783ff993f65154cb8fda0c8a46831ba4fb8ac0 100644 (file)
@@ -2152,7 +2152,7 @@ bnx2_init_board(struct pci_device *pdev, struct nic *nic)
        bnx2reg_base = pci_bar_start(pdev, PCI_BASE_ADDRESS_0);
        bnx2reg_len = MB_GET_CID_ADDR(17);
 
-       bp->regview = ioremap(bnx2reg_base, bnx2reg_len);
+       bp->regview = pci_ioremap(pdev, bnx2reg_base, bnx2reg_len);
 
        if (!bp->regview) {
                printf("Cannot map register space, aborting.\n");
index e6bceb97038c92df923bdade8506c57e79040df1..fe84ea0e4398725d94f5a439f6d63684adb9e25f 100644 (file)
@@ -60,7 +60,7 @@ static void *bnxt_pci_base ( struct pci_device *pdev, unsigned int reg )
 
        reg_base = pci_bar_start ( pdev, reg );
        reg_size = pci_bar_size ( pdev, reg );
-       return ioremap ( reg_base, reg_size );
+       return pci_ioremap ( pdev, reg_base, reg_size );
 }
 
 static int bnxt_get_pci_info ( struct bnxt *bp )
index 0f25c0beb4ea3b2b9ea273101c4b0bd0cad1300e..5c76eb6fd480db68c68b1a49b9147a520fa54b2f 100644 (file)
@@ -933,7 +933,7 @@ static int ena_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       ena->regs = ioremap ( pci->membase, ENA_BAR_SIZE );
+       ena->regs = pci_ioremap ( pci, pci->membase, ENA_BAR_SIZE );
        if ( ! ena->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
index 2cd41d4cab51fa7733cec492a478b2a554cf1ee3..cd567f1d9ce9fd98e35db8d2dd7184353df55ce2 100644 (file)
@@ -4150,7 +4150,7 @@ efab_probe ( struct pci_device *pci )
        /* Get iobase/membase */
        mmio_start = pci_bar_start ( pci, PCI_BASE_ADDRESS_2 );
        mmio_len = pci_bar_size ( pci, PCI_BASE_ADDRESS_2 );
-       efab->membase = ioremap ( mmio_start, mmio_len );
+       efab->membase = pci_ioremap ( pci, mmio_start, mmio_len );
        EFAB_TRACE ( "BAR of %lx bytes at phys %lx mapped at %p\n",
                     mmio_len, mmio_start, efab->membase );
 
index 287e14e8d887b65ffb3594ee0eeea178f491fc69..8849da285806b82bf990054515883687d79a7d7d 100644 (file)
@@ -800,7 +800,7 @@ static int exanic_probe ( struct pci_device *pci ) {
 
        /* Map registers */
        regs_bar_start = pci_bar_start ( pci, EXANIC_REGS_BAR );
-       exanic->regs = ioremap ( regs_bar_start, EXANIC_REGS_LEN );
+       exanic->regs = pci_ioremap ( pci, regs_bar_start, EXANIC_REGS_LEN );
        if ( ! exanic->regs ) {
                rc = -ENODEV;
                goto err_ioremap_regs;
@@ -824,7 +824,7 @@ static int exanic_probe ( struct pci_device *pci ) {
        /* Map transmit region */
        tx_bar_start = pci_bar_start ( pci, EXANIC_TX_BAR );
        tx_bar_len = pci_bar_size ( pci, EXANIC_TX_BAR );
-       exanic->tx = ioremap ( tx_bar_start, tx_bar_len );
+       exanic->tx = pci_ioremap ( pci, tx_bar_start, tx_bar_len );
        if ( ! exanic->tx ) {
                rc = -ENODEV;
                goto err_ioremap_tx;
index 7f044b192e3a44763746ca18093e3a0ecdac2115..94cc6063b3e1e26b54d1c2770c337d8e9328896c 100644 (file)
@@ -1762,7 +1762,7 @@ forcedeth_map_regs ( struct forcedeth_private *priv )
        }
 
        rc = -ENOMEM;
-       ioaddr = ioremap ( addr, register_size );
+       ioaddr = pci_ioremap ( priv->pci_dev, addr, register_size );
        if ( ! ioaddr ) {
                DBG ( "Cannot remap MMIO\n" );
                goto err_ioremap;
index 4bed924270162c2d8816468a29a1774ad1616ce3..58092faded496a2c12ebe6d6587c1ab56510b887 100644 (file)
@@ -726,7 +726,7 @@ static int icplus_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       icp->regs = ioremap ( pci->membase, ICP_BAR_SIZE );
+       icp->regs = pci_ioremap ( pci, pci->membase, ICP_BAR_SIZE );
        if ( ! icp->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
index fc7021c38cb47b11b293f7be3a3b2b7cf6317999..39d4e7f8ab3d8a69a851f1285a9f28bbbfc1d4f2 100644 (file)
@@ -843,7 +843,7 @@ int igbvf_probe ( struct pci_device *pdev )
        DBG ( "mmio_start: %#08lx\n", mmio_start );
        DBG ( "mmio_len: %#08lx\n", mmio_len );
 
-       adapter->hw.hw_addr = ioremap ( mmio_start, mmio_len );
+       adapter->hw.hw_addr = pci_ioremap ( pdev, mmio_start, mmio_len );
        DBG ( "adapter->hw.hw_addr: %p\n", adapter->hw.hw_addr );
 
        if ( ! adapter->hw.hw_addr ) {
index d9b8b46b7973cd6de8b3b7380d9f02cffdbe7763..97f50a9436d9c8082800353f4369840c372884d2 100644 (file)
@@ -959,7 +959,7 @@ static int intel_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       intel->regs = ioremap ( pci->membase, INTEL_BAR_SIZE );
+       intel->regs = pci_ioremap ( pci, pci->membase, INTEL_BAR_SIZE );
        if ( ! intel->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
index 91fb7955f486f2c225c2cdc601e71df3cc6ca9ca..38e8467a9d760205104940a6e880b0666b8ef086 100644 (file)
@@ -405,7 +405,7 @@ static int intelx_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       intel->regs = ioremap ( pci->membase, INTEL_BAR_SIZE );
+       intel->regs = pci_ioremap ( pci, pci->membase, INTEL_BAR_SIZE );
        if ( ! intel->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
index c98ba265cf04ff06b7586dc2440b1569f41b2594..08c90bc48dc4dcf838424a21be5012deec9e50e1 100644 (file)
@@ -1673,7 +1673,7 @@ static int intelxl_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       intelxl->regs = ioremap ( pci->membase, INTELXL_BAR_SIZE );
+       intelxl->regs = pci_ioremap ( pci, pci->membase, INTELXL_BAR_SIZE );
        if ( ! intelxl->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
index 8f76daf3dd60a2a9d0004ed3b6d5efe7e58f0249..83e484c8d154c2908dc453de884ba7f0fd01f429 100644 (file)
@@ -612,7 +612,7 @@ static int intelxlvf_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       intelxl->regs = ioremap ( pci->membase, INTELXLVF_BAR_SIZE );
+       intelxl->regs = pci_ioremap ( pci, pci->membase, INTELXLVF_BAR_SIZE );
        if ( ! intelxl->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
index 2caeec27ea168c9d546d9cf0e6ed50ce6cb48f0f..fef3024e9c307ff192a59727d8a261fa9c71003b 100644 (file)
@@ -456,7 +456,7 @@ static int intelxvf_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       intel->regs = ioremap ( pci->membase, INTELVF_BAR_SIZE );
+       intel->regs = pci_ioremap ( pci, pci->membase, INTELVF_BAR_SIZE );
        if ( ! intel->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
index 29694b6992759b53603cf6633fb4641228b27988..b68b96c88b4041bf7baed0b0cff810915b415d60 100644 (file)
@@ -1191,7 +1191,7 @@ jme_probe(struct pci_device *pci)
        jme = netdev->priv;
        pci_set_drvdata(pci, netdev);
        netdev->dev = &pci->dev;
-       jme->regs = ioremap(pci->membase, JME_REGS_SIZE);
+       jme->regs = pci_ioremap(pci, pci->membase, JME_REGS_SIZE);
        if (!(jme->regs)) {
                DBG("Mapping PCI resource region error.\n");
                rc = -ENOMEM;
index 84a5505964b42fd55ad3766a0c14e61e20f56a99..4dd0aab4aed9b604cd780ceff7b894aab6bda9ce 100644 (file)
@@ -606,7 +606,7 @@ static int myson_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       myson->regs = ioremap ( pci->membase, MYSON_BAR_SIZE );
+       myson->regs = pci_ioremap ( pci, pci->membase, MYSON_BAR_SIZE );
        if ( ! myson->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
index 9f2c3029c58f4a60f92d125837b70425919c7ea6..33cf68b3c9f5899e3a8f453726645b95b3f72ba6 100644 (file)
@@ -853,7 +853,7 @@ static int natsemi_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       natsemi->regs = ioremap ( pci->membase, NATSEMI_BAR_SIZE );
+       natsemi->regs = pci_ioremap ( pci, pci->membase, NATSEMI_BAR_SIZE );
        if ( ! natsemi->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
index 781049ff4044c787cb8fa32624fa30a71c484dc3..8f247ff8e54b1fcaa92833115c26d28bb07a3770 100644 (file)
@@ -1837,7 +1837,7 @@ static int phantom_map_crb ( struct phantom_nic *phantom,
                return -EINVAL;
        }
 
-       phantom->bar0 = ioremap ( bar0_start, bar0_size );
+       phantom->bar0 = pci_ioremap ( pci, bar0_start, bar0_size );
        if ( ! phantom->bar0 ) {
                DBGC ( phantom, "Phantom %p could not map BAR0\n", phantom );
                return -EIO;
index 69ddf0fb01e608e3ab92944798deff67ab77f36a..2feb695224ad22559d53b75438bcc8b8996d11df 100644 (file)
@@ -36,7 +36,7 @@ static int prism2_pci_probe ( struct nic *nic, struct pci_device *pci ) {
   hfa384x_t *hw = &hw_global;
 
   printf ( "Prism2.5 has registers at %#lx\n", pci->membase );
-  hw->membase = ioremap ( pci->membase, 0x100 );
+  hw->membase = pci_ioremap ( pci, pci->membase, 0x100 );
 
   nic->ioaddr = pci->membase;
   nic->irqno = 0;
index 310b9f96a8349bde35ac4e48feac7c1f64851071..0421b4db7d0dbc094f69adf22defa0cd02977f58 100644 (file)
@@ -1128,7 +1128,7 @@ static int realtek_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       rtl->regs = ioremap ( pci->membase, RTL_BAR_SIZE );
+       rtl->regs = pci_ioremap ( pci, pci->membase, RTL_BAR_SIZE );
        if ( ! rtl->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
index a1dc5872520d41fd43d5739d94bbac1ee56df501..cbe21c316e2e4c18026d3bc0d10be6f2865b73c2 100644 (file)
@@ -700,7 +700,7 @@ static int rhine_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       rhn->regs = ioremap ( pci->membase, RHINE_BAR_SIZE );
+       rhn->regs = pci_ioremap ( pci, pci->membase, RHINE_BAR_SIZE );
        rhn->ioaddr = pci->ioaddr;
        DBGC ( rhn, "RHINE %p regs at %08lx, I/O at %04lx\n", rhn,
               pci->membase, pci->ioaddr );
index 40388770789aa014e1b256c7c0136a88814f43ad..fd465612ea2144dd53471e7e09a0ae0e51c5e55a 100644 (file)
@@ -85,7 +85,7 @@ void efx_probe(struct net_device *netdev, enum efx_revision revision)
 
        efx->mmio_start = pci_bar_start(pci, reg);
        efx->mmio_len = pci_bar_size(pci, reg);
-       efx->membase = ioremap(efx->mmio_start, efx->mmio_len);
+       efx->membase = pci_ioremap(pci, efx->mmio_start, efx->mmio_len);
 
        DBGCP(efx, "BAR of %lx bytes at phys %lx mapped at %p\n",
              efx->mmio_len, efx->mmio_start, efx->membase);
index b92e95f2a889d84f5bac7268d7c65c6a6cfca742..11dda1c97198f307fa622ca1c2155ba789a45b4c 100644 (file)
@@ -886,7 +886,7 @@ static int sis190_init_board(struct pci_device *pdev, struct net_device **netdev
 
        adjust_pci_device(pdev);
 
-       ioaddr = ioremap(pdev->membase, SIS190_REGS_SIZE);
+       ioaddr = pci_ioremap(pdev, pdev->membase, SIS190_REGS_SIZE);
        if (!ioaddr) {
                DBG("sis190: cannot remap MMIO, aborting\n");
                rc = -EIO;
index 0bae3089cc42dfe33b2fa15a7cef8c86ea481f30..a76c6e3d9386980f8f1027892fb6021188c77121 100644 (file)
@@ -195,7 +195,7 @@ static int skeleton_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       skel->regs = ioremap ( pci->membase, SKELETON_BAR_SIZE );
+       skel->regs = pci_ioremap ( pci, pci->membase, SKELETON_BAR_SIZE );
        if ( ! skel->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
index c3264225b24645149a87aaf9b1c0590ccd93c808..c9a7891ba8afe0e2d6da837195e8c7cb60fd6fac 100755 (executable)
@@ -2346,8 +2346,9 @@ static int skge_probe(struct pci_device *pdev)
 
        hw->pdev = pdev;
 
-       hw->regs = (unsigned long)ioremap(pci_bar_start(pdev, PCI_BASE_ADDRESS_0),
-                               SKGE_REG_SIZE);
+       hw->regs = (unsigned long)pci_ioremap(pdev,
+                                             pci_bar_start(pdev, PCI_BASE_ADDRESS_0),
+                                             SKGE_REG_SIZE);
        if (!hw->regs) {
                DBG(PFX "cannot map device registers\n");
                goto err_out_free_hw;
index 211f224668991830d921e962267dd5f5bc938f1f..0d11e17dfde81076a945e6f2715d513b70490da9 100644 (file)
@@ -2278,7 +2278,7 @@ static int sky2_probe(struct pci_device *pdev)
 
        hw->pdev = pdev;
 
-       hw->regs = (unsigned long)ioremap(pci_bar_start(pdev, PCI_BASE_ADDRESS_0), 0x4000);
+       hw->regs = (unsigned long)pci_ioremap(pdev, pci_bar_start(pdev, PCI_BASE_ADDRESS_0), 0x4000);
        if (!hw->regs) {
                DBG(PFX "cannot map device registers\n");
                goto err_out_free_hw;
index 1bed06649c4e9dcc78ee0485bc8c5a5483f81a38..f6c0381122559832a1a106aa185732a5136c5bb0 100644 (file)
@@ -771,7 +771,7 @@ static int tg3_init_one(struct pci_device *pdev)
        reg_base = pci_bar_start(pdev, PCI_BASE_ADDRESS_0);
        reg_size = pci_bar_size(pdev, PCI_BASE_ADDRESS_0);
 
-       tp->regs = ioremap(reg_base, reg_size);
+       tp->regs = pci_ioremap(pdev, reg_base, reg_size);
        if (!tp->regs) {
                DBGC(&pdev->dev, "Failed to remap device registers\n");
                errno = -ENOENT;
index 9ddb98ab8548a2a6bcc3a6660509c99ec7c45ead..1865a9b9178835fe65845c90e68e733c21997aa5 100644 (file)
@@ -645,11 +645,11 @@ static void txnic_poll ( struct txnic *vnic ) {
 /**
  * Allocate virtual NIC
  *
- * @v dev              Underlying device
+ * @v pci              Underlying PCI device
  * @v membase          Register base address
  * @ret vnic           Virtual NIC, or NULL on failure
  */
-static struct txnic * txnic_alloc ( struct device *dev,
+static struct txnic * txnic_alloc ( struct pci_device *pci,
                                    unsigned long membase ) {
        struct net_device *netdev;
        struct txnic *vnic;
@@ -658,10 +658,10 @@ static struct txnic * txnic_alloc ( struct device *dev,
        netdev = alloc_etherdev ( sizeof ( *vnic ) );
        if ( ! netdev )
                goto err_alloc_netdev;
-       netdev->dev = dev;
+       netdev->dev = &pci->dev;
        vnic = netdev->priv;
        vnic->netdev = netdev;
-       vnic->name = dev->name;
+       vnic->name = pci->dev.name;
 
        /* Allow caller to reuse netdev->priv.  (The generic virtual
         * NIC code never assumes that netdev->priv==vnic.)
@@ -684,7 +684,7 @@ static struct txnic * txnic_alloc ( struct device *dev,
                goto err_alloc_rq;
 
        /* Map registers */
-       vnic->regs = ioremap ( membase, TXNIC_VF_BAR_SIZE );
+       vnic->regs = pci_ioremap ( pci, membase, TXNIC_VF_BAR_SIZE );
        if ( ! vnic->regs )
                goto err_ioremap;
 
@@ -1103,7 +1103,7 @@ static int txnic_lmac_probe ( struct txnic_lmac *lmac ) {
        membase = ( pf->vf_membase + ( lmac->idx * pf->vf_stride ) );
 
        /* Allocate and initialise network device */
-       vnic = txnic_alloc ( &bgx->pci->dev, membase );
+       vnic = txnic_alloc ( bgx->pci, membase );
        if ( ! vnic ) {
                rc = -ENOMEM;
                goto err_alloc;
@@ -1275,7 +1275,7 @@ static int txnic_pf_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       pf->regs = ioremap ( membase, TXNIC_PF_BAR_SIZE );
+       pf->regs = pci_ioremap ( pci, membase, TXNIC_PF_BAR_SIZE );
        if ( ! pf->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
@@ -1633,7 +1633,7 @@ static int txnic_bgx_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       bgx->regs = ioremap ( membase, TXNIC_BGX_BAR_SIZE );
+       bgx->regs = pci_ioremap ( pci, membase, TXNIC_BGX_BAR_SIZE );
        if ( ! bgx->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
index 0a2a3ac1083ec9df454cabfab06358388f0d3889..994e07a64d3d71eda8aa617d015e83c2e7767d00 100644 (file)
@@ -731,7 +731,7 @@ static int velocity_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map registers */
-       vlc->regs = ioremap ( pci->membase, VELOCITY_BAR_SIZE );
+       vlc->regs = pci_ioremap ( pci, pci->membase, VELOCITY_BAR_SIZE );
        vlc->netdev = netdev;
 
        /* Reset the NIC */
index 6a54dbf890c16d731e5d9390c490d279550d05b7..3e0ab03cdf9d31a545fcaca6a2e31dba3b32c5da 100644 (file)
@@ -641,14 +641,14 @@ static int vmxnet3_probe ( struct pci_device *pci ) {
        adjust_pci_device ( pci );
 
        /* Map PCI BARs */
-       vmxnet->pt = ioremap ( pci_bar_start ( pci, VMXNET3_PT_BAR ),
-                              VMXNET3_PT_LEN );
+       vmxnet->pt = pci_ioremap ( pci, pci_bar_start ( pci, VMXNET3_PT_BAR ),
+                                  VMXNET3_PT_LEN );
        if ( ! vmxnet->pt ) {
                rc = -ENODEV;
                goto err_ioremap_pt;
        }
-       vmxnet->vd = ioremap ( pci_bar_start ( pci, VMXNET3_VD_BAR ),
-                              VMXNET3_VD_LEN );
+       vmxnet->vd = pci_ioremap ( pci, pci_bar_start ( pci, VMXNET3_VD_BAR ),
+                                  VMXNET3_VD_LEN );
        if ( ! vmxnet->vd ) {
                rc = -ENODEV;
                goto err_ioremap_vd;
index 8b099c0e2d1ea5bb5dbcc35bc3b35846a3a98418..6319283183e968d5743ca952545189f62034435f 100644 (file)
@@ -520,7 +520,7 @@ vxge_probe(struct pci_device *pdev)
        /* sets the bus master */
        adjust_pci_device(pdev);
 
-       bar0 = ioremap(mmio_start, mmio_len);
+       bar0 = pci_ioremap(pdev, mmio_start, mmio_len);
        if (!bar0) {
                vxge_debug(VXGE_ERR,
                        "%s : cannot remap io memory bar0\n", __func__);
index 29c32b356341f1382ccb707e721ef58c6d883832..15193efe12f1854a7a5980c466c90cb5c42c1dac 100644 (file)
@@ -1989,7 +1989,7 @@ static int ehci_probe ( struct pci_device *pci ) {
        /* Map registers */
        bar_start = pci_bar_start ( pci, EHCI_BAR );
        bar_size = pci_bar_size ( pci, EHCI_BAR );
-       ehci->regs = ioremap ( bar_start, bar_size );
+       ehci->regs = pci_ioremap ( pci, bar_start, bar_size );
        if ( ! ehci->regs ) {
                rc = -ENODEV;
                goto err_ioremap;
index aa6ca73c4779971742f602fe0b43cb81ff8ef4d0..c4a1dc33756fec05a051ef55660ea4b55e7439c6 100644 (file)
@@ -3261,7 +3261,7 @@ static int xhci_probe ( struct pci_device *pci ) {
        /* Map registers */
        bar_start = pci_bar_start ( pci, XHCI_BAR );
        bar_size = pci_bar_size ( pci, XHCI_BAR );
-       xhci->regs = ioremap ( bar_start, bar_size );
+       xhci->regs = pci_ioremap ( pci, bar_start, bar_size );
        if ( ! xhci->regs ) {
                rc = -ENODEV;
                goto err_ioremap;