@@ -377,8 +377,9 @@ static void q800_machine_init(MachineState *machine)
/* SCSI */
- dev = qdev_new(TYPE_SYSBUS_ESP);
- sysbus_esp = SYSBUS_ESP(dev);
+ object_initialize_child(OBJECT(machine), "esp", &m->esp,
+ TYPE_SYSBUS_ESP);
+ sysbus_esp = SYSBUS_ESP(&m->esp);
esp = &sysbus_esp->esp;
esp->dma_memory_read = NULL;
esp->dma_memory_write = NULL;
@@ -386,8 +387,8 @@ static void q800_machine_init(MachineState *machine)
sysbus_esp->it_shift = 4;
esp->dma_enabled = 1;
- sysbus = SYS_BUS_DEVICE(dev);
- sysbus_realize_and_unref(sysbus, &error_fatal);
+ sysbus = SYS_BUS_DEVICE(&m->esp);
+ sysbus_realize(sysbus, &error_fatal);
/* SCSI and SCSI data IRQs are negative edge triggered */
sysbus_connect_irq(sysbus, 0,
qemu_irq_invert(
@@ -28,6 +28,7 @@
#include "hw/net/dp8393x.h"
#include "hw/char/escc.h"
#include "hw/or-irq.h"
+#include "hw/scsi/esp.h"
/*
* The main Q800 machine
@@ -44,6 +45,7 @@ struct Q800MachineState {
dp8393xState dp8393x;
ESCCState escc;
OrIRQState escc_orgate;
+ SysBusESPState esp;
MemoryRegion macio;
MemoryRegion macio_alias;
};
Also change the instantiation of the ESP device to use object_initialize_child(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> --- hw/m68k/q800.c | 9 +++++---- include/hw/m68k/q800.h | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-)