summary refs log tree commit diff stats
path: root/hw/usb-ohci.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/usb-ohci.c')
-rw-r--r--hw/usb-ohci.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index a4f8aa6e31..6808579563 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -59,8 +59,7 @@ enum ohci_type {
 };
 
 typedef struct {
-    void *pic;
-    int irq;
+    qemu_irq irq;
     enum ohci_type type;
     target_phys_addr_t mem_base;
     int mem;
@@ -282,10 +281,7 @@ static inline void ohci_intr_update(OHCIState *ohci)
         (ohci->intr_status & ohci->intr))
         level = 1;
 
-    if (ohci->type == OHCI_TYPE_PCI)
-      pci_set_irq((PCIDevice *)ohci->pic, ohci->irq, level);
-    else
-      pic_set_irq_new(ohci->pic, ohci->irq, level);
+    qemu_set_irq(ohci->irq, level);
 }
 
 /* Set an interrupt */
@@ -1263,7 +1259,7 @@ static CPUWriteMemoryFunc *ohci_writefn[3]={
 };
 
 static void usb_ohci_init(OHCIState *ohci, int num_ports, int devfn,
-            void *pic, int irq, enum ohci_type type, const char *name)
+            qemu_irq irq, enum ohci_type type, const char *name)
 {
     int i;
 
@@ -1286,7 +1282,6 @@ static void usb_ohci_init(OHCIState *ohci, int num_ports, int devfn,
     ohci->mem = cpu_register_io_memory(0, ohci_readfn, ohci_writefn, ohci);
     ohci->name = name;
 
-    ohci->pic = pic;
     ohci->irq = irq;
     ohci->type = type;
 
@@ -1334,19 +1329,19 @@ void usb_ohci_init_pci(struct PCIBus *bus, int num_ports, int devfn)
     ohci->pci_dev.config[0x0b] = 0xc;
     ohci->pci_dev.config[0x3d] = 0x01; /* interrupt pin 1 */
 
-    usb_ohci_init(&ohci->state, num_ports, devfn, &ohci->pci_dev,
-                  0, OHCI_TYPE_PCI, ohci->pci_dev.name);
+    usb_ohci_init(&ohci->state, num_ports, devfn, ohci->pci_dev.irq[0],
+                  OHCI_TYPE_PCI, ohci->pci_dev.name);
 
     pci_register_io_region((struct PCIDevice *)ohci, 0, 256,
                            PCI_ADDRESS_SPACE_MEM, ohci_mapfunc);
 }
 
 void usb_ohci_init_pxa(target_phys_addr_t base, int num_ports, int devfn,
-            void *pic, int irq)
+                       qemu_irq irq)
 {
     OHCIState *ohci = (OHCIState *)qemu_mallocz(sizeof(OHCIState));
 
-    usb_ohci_init(ohci, num_ports, devfn, pic, irq,
+    usb_ohci_init(ohci, num_ports, devfn, irq,
                   OHCI_TYPE_PXA, "OHCI USB");
     ohci->mem_base = base;