aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-09-28 19:18:02 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-12-29 12:24:11 -0500
commit25729a7fb88ef2912fcb869abe3a76b3be07fc06 (patch)
tree146e6282ac25d0e00987891a73c02f1682e39b7c
parentdecf67e31e855963f4616912d9bc5b1c339d810a (diff)
[SCSI] advansys, arcmsr, ipr, nsp32, qla1280, stex: use pci_ioremap_bar()
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>
-rw-r--r--drivers/scsi/advansys.c3
-rw-r--r--drivers/scsi/arcmsr/arcmsr_hba.c8
-rw-r--r--drivers/scsi/ipr.c2
-rw-r--r--drivers/scsi/nsp32.c3
-rw-r--r--drivers/scsi/qla1280.c3
-rw-r--r--drivers/scsi/stex.c3
6 files changed, 8 insertions, 14 deletions
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 399fe559e4de..2f602720193e 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -13425,8 +13425,7 @@ static int __devinit advansys_board_found(struct Scsi_Host *shost,
13425 } 13425 }
13426 13426
13427 boardp->asc_n_io_port = pci_resource_len(pdev, 1); 13427 boardp->asc_n_io_port = pci_resource_len(pdev, 1);
13428 boardp->ioremap_addr = ioremap(pci_resource_start(pdev, 1), 13428 boardp->ioremap_addr = pci_ioremap_bar(pdev, 1);
13429 boardp->asc_n_io_port);
13430 if (!boardp->ioremap_addr) { 13429 if (!boardp->ioremap_addr) {
13431 shost_printk(KERN_ERR, shost, "ioremap(%lx, %d) " 13430 shost_printk(KERN_ERR, shost, "ioremap(%lx, %d) "
13432 "returned NULL\n", 13431 "returned NULL\n",
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index f91f79c8007d..106c04d2d793 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -235,7 +235,7 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb)
235 uint32_t intmask_org; 235 uint32_t intmask_org;
236 int i, j; 236 int i, j;
237 237
238 acb->pmuA = ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); 238 acb->pmuA = pci_ioremap_bar(pdev, 0);
239 if (!acb->pmuA) { 239 if (!acb->pmuA) {
240 printk(KERN_NOTICE "arcmsr%d: memory mapping region fail \n", 240 printk(KERN_NOTICE "arcmsr%d: memory mapping region fail \n",
241 acb->host->host_no); 241 acb->host->host_no);
@@ -329,13 +329,11 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb)
329 reg = (struct MessageUnit_B *)(dma_coherent + 329 reg = (struct MessageUnit_B *)(dma_coherent +
330 ARCMSR_MAX_FREECCB_NUM * sizeof(struct CommandControlBlock)); 330 ARCMSR_MAX_FREECCB_NUM * sizeof(struct CommandControlBlock));
331 acb->pmuB = reg; 331 acb->pmuB = reg;
332 mem_base0 = ioremap(pci_resource_start(pdev, 0), 332 mem_base0 = pci_ioremap_bar(pdev, 0);
333 pci_resource_len(pdev, 0));
334 if (!mem_base0) 333 if (!mem_base0)
335 goto out; 334 goto out;
336 335
337 mem_base1 = ioremap(pci_resource_start(pdev, 2), 336 mem_base1 = pci_ioremap_bar(pdev, 2);
338 pci_resource_len(pdev, 2));
339 if (!mem_base1) { 337 if (!mem_base1) {
340 iounmap(mem_base0); 338 iounmap(mem_base0);
341 goto out; 339 goto out;
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index ded854a6dd35..ec53c220cb37 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -7473,7 +7473,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev,
7473 goto out_scsi_host_put; 7473 goto out_scsi_host_put;
7474 } 7474 }
7475 7475
7476 ipr_regs = ioremap(ipr_regs_pci, pci_resource_len(pdev, 0)); 7476 ipr_regs = pci_ioremap_bar(pdev, 0);
7477 7477
7478 if (!ipr_regs) { 7478 if (!ipr_regs) {
7479 dev_err(&pdev->dev, 7479 dev_err(&pdev->dev,
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index 22052bb7becb..d06ec5aa6924 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -3401,8 +3401,7 @@ static int __devinit nsp32_probe(struct pci_dev *pdev, const struct pci_device_i
3401 data->IrqNumber = pdev->irq; 3401 data->IrqNumber = pdev->irq;
3402 data->BaseAddress = pci_resource_start(pdev, 0); 3402 data->BaseAddress = pci_resource_start(pdev, 0);
3403 data->NumAddress = pci_resource_len (pdev, 0); 3403 data->NumAddress = pci_resource_len (pdev, 0);
3404 data->MmioAddress = ioremap_nocache(pci_resource_start(pdev, 1), 3404 data->MmioAddress = pci_ioremap_bar(pdev, 1);
3405 pci_resource_len (pdev, 1));
3406 data->MmioLength = pci_resource_len (pdev, 1); 3405 data->MmioLength = pci_resource_len (pdev, 1);
3407 3406
3408 pci_set_master(pdev); 3407 pci_set_master(pdev);
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index b6cd12b2e996..8cb9240596ab 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -4294,8 +4294,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
4294 error = -ENODEV; 4294 error = -ENODEV;
4295 4295
4296#if MEMORY_MAPPED_IO 4296#if MEMORY_MAPPED_IO
4297 ha->mmpbase = ioremap(pci_resource_start(ha->pdev, 1), 4297 ha->mmpbase = pci_ioremap_bar(ha->pdev, 1);
4298 pci_resource_len(ha->pdev, 1));
4299 if (!ha->mmpbase) { 4298 if (!ha->mmpbase) {
4300 printk(KERN_INFO "qla1280: Unable to map I/O memory\n"); 4299 printk(KERN_INFO "qla1280: Unable to map I/O memory\n");
4301 goto error_free_response_ring; 4300 goto error_free_response_ring;
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index 2fa830c0be27..a3a18ad73125 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -1108,8 +1108,7 @@ stex_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1108 goto out_scsi_host_put; 1108 goto out_scsi_host_put;
1109 } 1109 }
1110 1110
1111 hba->mmio_base = ioremap_nocache(pci_resource_start(pdev, 0), 1111 hba->mmio_base = pci_ioremap_bar(pdev, 0);
1112 pci_resource_len(pdev, 0));
1113 if ( !hba->mmio_base) { 1112 if ( !hba->mmio_base) {
1114 printk(KERN_ERR DRV_NAME "(%s): memory map failed\n", 1113 printk(KERN_ERR DRV_NAME "(%s): memory map failed\n",
1115 pci_name(pdev)); 1114 pci_name(pdev));