aboutsummaryrefslogtreecommitdiff
path: root/hw/ide
diff options
context:
space:
mode:
Diffstat (limited to 'hw/ide')
-rw-r--r--hw/ide/core.c2
-rw-r--r--hw/ide/pci.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 5a42771..9d510b1 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2332,7 +2332,7 @@ static const IDEDMAOps ide_dma_nop_ops = {
void ide_register_restart_cb(IDEBus *bus)
{
- qemu_add_vm_change_state_handler(bus->dma->ops->restart_cb, bus->dma);
+ qemu_add_vm_change_state_handler(bus->dma->ops->restart_cb, bus);
}
static IDEDMA ide_dma_nop = {
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 62c88d7..45254d4 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -208,8 +208,8 @@ static void ide_restart_dma(IDEState *s, enum ide_dma_cmd dma_cmd)
/* TODO This should be common IDE code */
static void bmdma_restart_bh(void *opaque)
{
- BMDMAState *bm = opaque;
- IDEBus *bus = bm->bus;
+ IDEBus *bus = opaque;
+ BMDMAState *bm = DO_UPCAST(BMDMAState, dma, bus->dma);
IDEState *s;
bool is_read;
int error_status;
@@ -260,14 +260,14 @@ static void bmdma_restart_bh(void *opaque)
static void bmdma_restart_cb(void *opaque, int running, RunState state)
{
- IDEDMA *dma = opaque;
- BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma);
+ IDEBus *bus = opaque;
+ BMDMAState *bm = DO_UPCAST(BMDMAState, dma, bus->dma);
if (!running)
return;
if (!bm->bh) {
- bm->bh = qemu_bh_new(bmdma_restart_bh, &bm->dma);
+ bm->bh = qemu_bh_new(bmdma_restart_bh, bus);
qemu_bh_schedule(bm->bh);
}
}