]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SCSI] advansys, arcmsr, ipr, nsp32, qla1280, stex: use pci_ioremap_bar()
authorArjan van de Ven <arjan@linux.intel.com>
Sun, 28 Sep 2008 23:18:02 +0000 (16:18 -0700)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 29 Dec 2008 17:24:11 +0000 (11:24 -0600)
Use the newly introduced pci_ioremap_bar() function in drivers/scsi.
pci_ioremap_bar() just takes a pci device and a bar number, with the goal
of making it really hard to get wrong, while also having a central place
to stick sanity checks.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Matthew Wilcox <willy@linux.intel.com>
Cc: Brian King <brking@us.ibm.com>
Cc: Ed Lin <ed.lin@promise.com>
Cc: Nick Cheng <nick.cheng@areca.com.tw>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/advansys.c
drivers/scsi/arcmsr/arcmsr_hba.c
drivers/scsi/ipr.c
drivers/scsi/nsp32.c
drivers/scsi/qla1280.c
drivers/scsi/stex.c

index 399fe559e4defaf89a29c4883aaec7ca9ba0d9e4..2f602720193eeb652f323329000c733bb84ab9d8 100644 (file)
@@ -13425,8 +13425,7 @@ static int __devinit advansys_board_found(struct Scsi_Host *shost,
                }
 
                boardp->asc_n_io_port = pci_resource_len(pdev, 1);
-               boardp->ioremap_addr = ioremap(pci_resource_start(pdev, 1),
-                                              boardp->asc_n_io_port);
+               boardp->ioremap_addr = pci_ioremap_bar(pdev, 1);
                if (!boardp->ioremap_addr) {
                        shost_printk(KERN_ERR, shost, "ioremap(%lx, %d) "
                                        "returned NULL\n",
index f91f79c8007d50f69d4b99f22fdc711d970ad1b2..106c04d2d79374e68578c9abfdaf33231ebef3c0 100644 (file)
@@ -235,7 +235,7 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb)
                uint32_t intmask_org;
                int i, j;
 
-               acb->pmuA = ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
+               acb->pmuA = pci_ioremap_bar(pdev, 0);
                if (!acb->pmuA) {
                        printk(KERN_NOTICE "arcmsr%d: memory mapping region fail \n",
                                                        acb->host->host_no);
@@ -329,13 +329,11 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb)
                reg = (struct MessageUnit_B *)(dma_coherent +
                ARCMSR_MAX_FREECCB_NUM * sizeof(struct CommandControlBlock));
                acb->pmuB = reg;
-               mem_base0 = ioremap(pci_resource_start(pdev, 0),
-                                       pci_resource_len(pdev, 0));
+               mem_base0 = pci_ioremap_bar(pdev, 0);
                if (!mem_base0)
                        goto out;
 
-               mem_base1 = ioremap(pci_resource_start(pdev, 2),
-                                       pci_resource_len(pdev, 2));
+               mem_base1 = pci_ioremap_bar(pdev, 2);
                if (!mem_base1) {
                        iounmap(mem_base0);
                        goto out;
index ded854a6dd35bd0d916f630090fc87990cd59182..ec53c220cb37c3868ad586de94ed24017ab44d93 100644 (file)
@@ -7473,7 +7473,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev,
                goto out_scsi_host_put;
        }
 
-       ipr_regs = ioremap(ipr_regs_pci, pci_resource_len(pdev, 0));
+       ipr_regs = pci_ioremap_bar(pdev, 0);
 
        if (!ipr_regs) {
                dev_err(&pdev->dev,
index 22052bb7becb4023b170f2c6abbf56dea609770d..d06ec5aa69249f1f86dc24ef715907f66ba59fd5 100644 (file)
@@ -3401,8 +3401,7 @@ static int __devinit nsp32_probe(struct pci_dev *pdev, const struct pci_device_i
        data->IrqNumber   = pdev->irq;
        data->BaseAddress = pci_resource_start(pdev, 0);
        data->NumAddress  = pci_resource_len  (pdev, 0);
-       data->MmioAddress = ioremap_nocache(pci_resource_start(pdev, 1),
-                                              pci_resource_len  (pdev, 1));
+       data->MmioAddress = pci_ioremap_bar(pdev, 1);
        data->MmioLength  = pci_resource_len  (pdev, 1);
 
        pci_set_master(pdev);
index b6cd12b2e9963468e32d00472ae3d0fd8a7d41bb..8cb9240596ab5fc5d95c47bdbc2b7e5001ef9e06 100644 (file)
@@ -4294,8 +4294,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
        error = -ENODEV;
 
 #if MEMORY_MAPPED_IO
-       ha->mmpbase = ioremap(pci_resource_start(ha->pdev, 1),
-                             pci_resource_len(ha->pdev, 1));
+       ha->mmpbase = pci_ioremap_bar(ha->pdev, 1);
        if (!ha->mmpbase) {
                printk(KERN_INFO "qla1280: Unable to map I/O memory\n");
                goto error_free_response_ring;
index 2fa830c0be2790187e17e43cf6dc0ffb35df1da8..a3a18ad7312527acd35536c5b9a2f42a7370454a 100644 (file)
@@ -1108,8 +1108,7 @@ stex_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                goto out_scsi_host_put;
        }
 
-       hba->mmio_base = ioremap_nocache(pci_resource_start(pdev, 0),
-               pci_resource_len(pdev, 0));
+       hba->mmio_base = pci_ioremap_bar(pdev, 0);
        if ( !hba->mmio_base) {
                printk(KERN_ERR DRV_NAME "(%s): memory map failed\n",
                        pci_name(pdev));