qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 13/34] usb-ohci: convert to pci_bar_map


From: Blue Swirl
Subject: [Qemu-devel] [PATCH 13/34] usb-ohci: convert to pci_bar_map
Date: Thu, 22 Jul 2010 21:57:43 +0000

Use pci_bar_map() instead of a mapping function.

Signed-off-by: Blue Swirl <address@hidden>
---
 hw/usb-ohci.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index c60fd8d..992400e 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -1717,13 +1717,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);
@@ -1742,7 +1735,8 @@ static int usb_ohci_initfn_pci(struct PCIDevice *dev)

     /* TODO: avoid cast below by using dev */
     pci_register_bar((struct PCIDevice *)ohci, 0, 256,
-                           PCI_BASE_ADDRESS_SPACE_MEMORY, ohci_mapfunc);
+                     PCI_BASE_ADDRESS_SPACE_MEMORY, NULL);
+    pci_bar_map((struct PCIDevice *)ohci, 0, 0, 256, 0, ohci->state.mem);
     return 0;
 }

-- 
1.6.2.4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]