Patchwork [09/10] usb-ohci: convert to pci_register_bar_simple()

login
register
mail settings
Submitter Avi Kivity
Date April 4, 2011, 3:28 p.m.
Message ID <1301930887-20705-10-git-send-email-avi@redhat.com>
Download mbox | patch
Permalink /patch/89648/
State New
Headers show

Comments

Avi Kivity - April 4, 2011, 3:28 p.m.
Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/usb-ohci.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

Patch

diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index d2b14f7..73d47b8 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -1713,13 +1713,6 @@  typedef struct {
     OHCIState state;
 } OHCIPCIState;
 
-static void ohci_mapfunc(PCIDevice *pci_dev, int i,
-            pcibus_t addr, pcibus_t size, int type)
-{
-    OHCIPCIState *ohci = DO_UPCAST(OHCIPCIState, pci_dev, pci_dev);
-    cpu_register_physical_memory(addr, size, ohci->state.mem);
-}
-
 static int usb_ohci_initfn_pci(struct PCIDevice *dev)
 {
     OHCIPCIState *ohci = DO_UPCAST(OHCIPCIState, pci_dev, dev);
@@ -1737,8 +1730,7 @@  static int usb_ohci_initfn_pci(struct PCIDevice *dev)
     ohci->state.irq = ohci->pci_dev.irq[0];
 
     /* TODO: avoid cast below by using dev */
-    pci_register_bar(&ohci->pci_dev, 0, 256,
-                           PCI_BASE_ADDRESS_SPACE_MEMORY, ohci_mapfunc);
+    pci_register_bar_simple(&ohci->pci_dev, 0, 256, 0, ohci->state.mem);
     return 0;
 }