提交 8e8ce4b6 编写于 作者: A Arjan van de Ven 提交者: Greg Kroah-Hartman

USB: use pci_ioremap_bar() in drivers/usb

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: NArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 e64a5219
...@@ -172,9 +172,9 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) ...@@ -172,9 +172,9 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
if (!mmio_resource_enabled(pdev, 0)) if (!mmio_resource_enabled(pdev, 0))
return; return;
base = ioremap_nocache(pci_resource_start(pdev, 0), base = pci_ioremap_bar(pdev, 0);
pci_resource_len(pdev, 0)); if (base == NULL)
if (base == NULL) return; return;
/* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */ /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */
#ifndef __hppa__ #ifndef __hppa__
...@@ -221,9 +221,9 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev) ...@@ -221,9 +221,9 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
if (!mmio_resource_enabled(pdev, 0)) if (!mmio_resource_enabled(pdev, 0))
return; return;
base = ioremap_nocache(pci_resource_start(pdev, 0), base = pci_ioremap_bar(pdev, 0);
pci_resource_len(pdev, 0)); if (base == NULL)
if (base == NULL) return; return;
cap_length = readb(base); cap_length = readb(base);
op_reg_base = base + cap_length; op_reg_base = base + cap_length;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册