USB: use pci_ioremap_bar() in drivers/usb
authorArjan van de Ven <arjan@linux.intel.com>
Tue, 21 Oct 2008 04:46:01 +0000 (21:46 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 7 Jan 2009 17:59:49 +0000 (09:59 -0800)
Use the newly introduced pci_ioremap_bar() function in drivers/usb.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/pci-quirks.c

index ae6e70edd745769700e8dc9d7d20057ce371817c..15e4f1d92c7924a541b5150a008b513f9d955af2 100644 (file)
@@ -172,9 +172,9 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
        if (!mmio_resource_enabled(pdev, 0))
                return;
 
-       base = ioremap_nocache(pci_resource_start(pdev, 0),
-                                    pci_resource_len(pdev, 0));
-       if (base == NULL) return;
+       base = pci_ioremap_bar(pdev, 0);
+       if (base == NULL)
+               return;
 
 /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */
 #ifndef __hppa__
@@ -221,9 +221,9 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
        if (!mmio_resource_enabled(pdev, 0))
                return;
 
-       base = ioremap_nocache(pci_resource_start(pdev, 0),
-                               pci_resource_len(pdev, 0));
-       if (base == NULL) return;
+       base = pci_ioremap_bar(pdev, 0);
+       if (base == NULL)
+               return;
 
        cap_length = readb(base);
        op_reg_base = base + cap_length;