Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Arjan van de Ven and committed by
James Bottomley
25729a7f decf67e3

+8 -14
+1 -2
drivers/scsi/advansys.c
··· 13425 13425 } 13426 13426 13427 13427 boardp->asc_n_io_port = pci_resource_len(pdev, 1); 13428 - boardp->ioremap_addr = ioremap(pci_resource_start(pdev, 1), 13429 - boardp->asc_n_io_port); 13428 + boardp->ioremap_addr = pci_ioremap_bar(pdev, 1); 13430 13429 if (!boardp->ioremap_addr) { 13431 13430 shost_printk(KERN_ERR, shost, "ioremap(%lx, %d) " 13432 13431 "returned NULL\n",
+3 -5
drivers/scsi/arcmsr/arcmsr_hba.c
··· 235 235 uint32_t intmask_org; 236 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 239 if (!acb->pmuA) { 240 240 printk(KERN_NOTICE "arcmsr%d: memory mapping region fail \n", 241 241 acb->host->host_no); ··· 329 329 reg = (struct MessageUnit_B *)(dma_coherent + 330 330 ARCMSR_MAX_FREECCB_NUM * sizeof(struct CommandControlBlock)); 331 331 acb->pmuB = reg; 332 - mem_base0 = ioremap(pci_resource_start(pdev, 0), 333 - pci_resource_len(pdev, 0)); 332 + mem_base0 = pci_ioremap_bar(pdev, 0); 334 333 if (!mem_base0) 335 334 goto out; 336 335 337 - mem_base1 = ioremap(pci_resource_start(pdev, 2), 338 - pci_resource_len(pdev, 2)); 336 + mem_base1 = pci_ioremap_bar(pdev, 2); 339 337 if (!mem_base1) { 340 338 iounmap(mem_base0); 341 339 goto out;
+1 -1
drivers/scsi/ipr.c
··· 7473 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 7478 if (!ipr_regs) { 7479 7479 dev_err(&pdev->dev,
+1 -2
drivers/scsi/nsp32.c
··· 3401 3401 data->IrqNumber = pdev->irq; 3402 3402 data->BaseAddress = pci_resource_start(pdev, 0); 3403 3403 data->NumAddress = pci_resource_len (pdev, 0); 3404 - data->MmioAddress = ioremap_nocache(pci_resource_start(pdev, 1), 3405 - pci_resource_len (pdev, 1)); 3404 + data->MmioAddress = pci_ioremap_bar(pdev, 1); 3406 3405 data->MmioLength = pci_resource_len (pdev, 1); 3407 3406 3408 3407 pci_set_master(pdev);
+1 -2
drivers/scsi/qla1280.c
··· 4294 4294 error = -ENODEV; 4295 4295 4296 4296 #if MEMORY_MAPPED_IO 4297 - ha->mmpbase = ioremap(pci_resource_start(ha->pdev, 1), 4298 - pci_resource_len(ha->pdev, 1)); 4297 + ha->mmpbase = pci_ioremap_bar(ha->pdev, 1); 4299 4298 if (!ha->mmpbase) { 4300 4299 printk(KERN_INFO "qla1280: Unable to map I/O memory\n"); 4301 4300 goto error_free_response_ring;
+1 -2
drivers/scsi/stex.c
··· 1108 1108 goto out_scsi_host_put; 1109 1109 } 1110 1110 1111 - hba->mmio_base = ioremap_nocache(pci_resource_start(pdev, 0), 1112 - pci_resource_len(pdev, 0)); 1111 + hba->mmio_base = pci_ioremap_bar(pdev, 0); 1113 1112 if ( !hba->mmio_base) { 1114 1113 printk(KERN_ERR DRV_NAME "(%s): memory map failed\n", 1115 1114 pci_name(pdev));