]> err.no Git - linux-2.6/commitdiff
[PATCH] netdrvr: Convert cassini to pci_iomap
authorMarc Zyngier <maz@misterjones.org>
Thu, 13 Apr 2006 09:38:20 +0000 (11:38 +0200)
committerJeff Garzik <jeff@garzik.org>
Thu, 20 Apr 2006 21:42:05 +0000 (17:42 -0400)
Folks,

This patch (against 2.6.17-rc1) converts the cassini driver to the
pci_iomap API that will do the right thing, so architectures like
PARISC can stop screaming about illegal usage of ioremap() on
non-cacheable regions.

Tested on 64bit PARISC kernel.

Signed-off-by: Marc Zyngier <maz@misterjones.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/cassini.c

index ac48f7543500b7c53d5099383fa26c83c247a45e..39f36aa05aa8b005bf4b2b2638ef7f1a47810f6e 100644 (file)
@@ -4877,7 +4877,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
                                  const struct pci_device_id *ent)
 {
        static int cas_version_printed = 0;
-       unsigned long casreg_base, casreg_len;
+       unsigned long casreg_len;
        struct net_device *dev;
        struct cas *cp;
        int i, err, pci_using_dac;
@@ -4972,7 +4972,6 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
                pci_using_dac = 0;
        }
 
-       casreg_base = pci_resource_start(pdev, 0);
        casreg_len = pci_resource_len(pdev, 0);
 
        cp = netdev_priv(dev);
@@ -5024,7 +5023,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
        cp->timer_ticks = 0;
 
        /* give us access to cassini registers */
-       cp->regs = ioremap(casreg_base, casreg_len);
+       cp->regs = pci_iomap(pdev, 0, casreg_len);
        if (cp->regs == 0UL) {
                printk(KERN_ERR PFX "Cannot map device registers, "
                       "aborting.\n");
@@ -5123,7 +5122,7 @@ err_out_iounmap:
                cas_shutdown(cp);
        mutex_unlock(&cp->pm_mutex);
 
-       iounmap(cp->regs);
+       pci_iounmap(pdev, cp->regs);
 
 
 err_out_free_res:
@@ -5171,7 +5170,7 @@ static void __devexit cas_remove_one(struct pci_dev *pdev)
 #endif
        pci_free_consistent(pdev, sizeof(struct cas_init_block),
                            cp->init_block, cp->block_dvma);
-       iounmap(cp->regs);
+       pci_iounmap(pdev, cp->regs);
        free_netdev(dev);
        pci_release_regions(pdev);
        pci_disable_device(pdev);