@@ -525,10 +525,11 @@ static const MemoryRegionOps m5206_mbar_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
-qemu_irq *mcf5206_init(MemoryRegion *sysmem, uint32_t base, M68kCPU *cpu)
+void mcf5206_init(MemoryRegion *sysmem, uint32_t base, M68kCPU *cpu)
{
m5206_mbar_state *s;
qemu_irq *pic;
+ int i;
s = (m5206_mbar_state *)g_malloc0(sizeof(m5206_mbar_state));
@@ -543,6 +544,11 @@ qemu_irq *mcf5206_init(MemoryRegion *sysmem, uint32_t base, M68kCPU *cpu)
s->uart[1] = mcf_uart_init(pic[13], serial_hds[1]);
s->cpu = cpu;
+ for (i = 0; i < 9; i++) {
+ qemu_free_irq(pic[i]);
+ }
+ qemu_free_irq(pic[11]);
+ g_free(pic);
+
m5206_mbar_reset(s);
- return pic;
}
@@ -24,7 +24,6 @@ void mcf_fec_init(struct MemoryRegion *sysmem, NICInfo *nd,
hwaddr base, qemu_irq *irq);
/* mcf5206.c */
-qemu_irq *mcf5206_init(struct MemoryRegion *sysmem,
- uint32_t base, M68kCPU *cpu);
+void mcf5206_init(struct MemoryRegion *sysmem, uint32_t base, M68kCPU *cpu);
#endif