Skip to content

Commit

Permalink
USB: use pci_ioremap_bar() in drivers/usb
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arjan van de Ven authored and Greg Kroah-Hartman committed Jan 7, 2009
1 parent e64a521 commit 8e8ce4b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/usb/host/pci-quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8e8ce4b

Please sign in to comment.