Commit 1f1ab274 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Bartlomiej Zolnierkiewicz

ide: two more pci_ioremap_bar() conversions

based on suggestion from Sergei Shtylyov, there are two more places
where using pci_ioremap_bar() makes sense.
Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 28343562
...@@ -536,10 +536,6 @@ static u8 scc_udma_filter(ide_drive_t *drive) ...@@ -536,10 +536,6 @@ static u8 scc_udma_filter(ide_drive_t *drive)
static int setup_mmio_scc (struct pci_dev *dev, const char *name) static int setup_mmio_scc (struct pci_dev *dev, const char *name)
{ {
unsigned long ctl_base = pci_resource_start(dev, 0);
unsigned long dma_base = pci_resource_start(dev, 1);
unsigned long ctl_size = pci_resource_len(dev, 0);
unsigned long dma_size = pci_resource_len(dev, 1);
void __iomem *ctl_addr; void __iomem *ctl_addr;
void __iomem *dma_addr; void __iomem *dma_addr;
int i, ret; int i, ret;
...@@ -557,10 +553,12 @@ static int setup_mmio_scc (struct pci_dev *dev, const char *name) ...@@ -557,10 +553,12 @@ static int setup_mmio_scc (struct pci_dev *dev, const char *name)
return ret; return ret;
} }
if ((ctl_addr = ioremap(ctl_base, ctl_size)) == NULL) ctl_addr = pci_ioremap_bar(dev, 0);
if (!ctl_addr)
goto fail_0; goto fail_0;
if ((dma_addr = ioremap(dma_base, dma_size)) == NULL) dma_addr = pci_ioremap_bar(dev, 1);
if (!dma_addr)
goto fail_1; goto fail_1;
pci_set_master(dev); pci_set_master(dev);
......
...@@ -784,7 +784,7 @@ static int __devinit siimage_init_one(struct pci_dev *dev, ...@@ -784,7 +784,7 @@ static int __devinit siimage_init_one(struct pci_dev *dev,
printk(KERN_WARNING DRV_NAME " %s: MMIO ports not " printk(KERN_WARNING DRV_NAME " %s: MMIO ports not "
"available\n", pci_name(dev)); "available\n", pci_name(dev));
} else { } else {
ioaddr = ioremap(bar5, barsize); ioaddr = pci_ioremap_bar(dev, 5);
if (ioaddr == NULL) if (ioaddr == NULL)
release_mem_region(bar5, barsize); release_mem_region(bar5, barsize);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment