aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2008-10-17 12:09:17 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-17 12:09:17 -0400
commit107111d450541df8c2a8d3af1d538cc7cd85e81b (patch)
tree4393f425b37ebbf7939ec4b0eb817402e53b7ff3 /drivers
parent8108b882329db7fbf9fbca6559aa36e6174dc91f (diff)
sgiioc4: kill duplicate ioremap()
By the time ide_dma_sgiioc4() gets called, sgiioc4_ide_setup_pci_device() will have called ioremap() on the whole BAR0 region, so calling ioremap() on the DMA registers means wasting a page. Replace this call by a mere address calculation, based on the fact that IRQ registers (pointed to by 'hwif->io_ports.irq_addr') are situated at offset 0 from BAR0. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: jeremy@sgi.com Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/pci/sgiioc4.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index f6c5ba07be71..8af9b23499fd 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -320,7 +320,6 @@ ide_dma_sgiioc4(ide_hwif_t *hwif, const struct ide_port_info *d)
320{ 320{
321 struct pci_dev *dev = to_pci_dev(hwif->dev); 321 struct pci_dev *dev = to_pci_dev(hwif->dev);
322 unsigned long dma_base = pci_resource_start(dev, 0) + IOC4_DMA_OFFSET; 322 unsigned long dma_base = pci_resource_start(dev, 0) + IOC4_DMA_OFFSET;
323 void __iomem *virt_dma_base;
324 int num_ports = sizeof (ioc4_dma_regs_t); 323 int num_ports = sizeof (ioc4_dma_regs_t);
325 void *pad; 324 void *pad;
326 325
@@ -333,14 +332,8 @@ ide_dma_sgiioc4(ide_hwif_t *hwif, const struct ide_port_info *d)
333 return -1; 332 return -1;
334 } 333 }
335 334
336 virt_dma_base = ioremap(dma_base, num_ports); 335 hwif->dma_base = (unsigned long)hwif->io_ports.irq_addr +
337 if (virt_dma_base == NULL) { 336 IOC4_DMA_OFFSET;
338 printk(KERN_ERR "%s(%s) -- ERROR: unable to map addresses "
339 "0x%lx to 0x%lx\n", __func__, hwif->name,
340 dma_base, dma_base + num_ports - 1);
341 goto dma_remap_failure;
342 }
343 hwif->dma_base = (unsigned long) virt_dma_base;
344 337
345 hwif->sg_max_nents = IOC4_PRD_ENTRIES; 338 hwif->sg_max_nents = IOC4_PRD_ENTRIES;
346 339
@@ -364,9 +357,6 @@ ide_dma_sgiioc4(ide_hwif_t *hwif, const struct ide_port_info *d)
364 printk(KERN_INFO "%s: changing from DMA to PIO mode", hwif->name); 357 printk(KERN_INFO "%s: changing from DMA to PIO mode", hwif->name);
365 358
366dma_pci_alloc_failure: 359dma_pci_alloc_failure:
367 iounmap(virt_dma_base);
368
369dma_remap_failure:
370 release_mem_region(dma_base, num_ports); 360 release_mem_region(dma_base, num_ports);
371 361
372 return -1; 362 return -1;