]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/scc_pata.c
ide: Switch to a common address
[linux-2.6-omap-h63xx.git] / drivers / ide / scc_pata.c
index 49f163aa51e3197773c0ac626ad094cca96d6630..0f48f9dacfa5e003ab307482c06ed3f9b3fdb6e9 100644 (file)
@@ -5,7 +5,7 @@
  *
  * This code is based on drivers/ide/pci/siimage.c:
  * Copyright (C) 2001-2002     Andre Hedrick <andre@linux-ide.org>
- * Copyright (C) 2003          Red Hat <alan@redhat.com>
+ * Copyright (C) 2003          Red Hat
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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)
 {
-       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 *dma_addr;
        int i, ret;
@@ -557,10 +553,12 @@ static int setup_mmio_scc (struct pci_dev *dev, const char *name)
                return ret;
        }
 
-       if ((ctl_addr = ioremap(ctl_base, ctl_size)) == NULL)
+       ctl_addr = pci_ioremap_bar(dev, 0);
+       if (!ctl_addr)
                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;
 
        pci_set_master(dev);