diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-08-04 17:11:12 -0400 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-08-15 18:03:12 +0100 |
commit | 0e7ce54cf5fb9b7e8d19a5a4eb1facf123edbcef (patch) | |
tree | c1b2d03fedeec26e1dd2b9ebd1de9c093c091102 /hw/ide/pci.c | |
parent | 0def37baf9add908c5462b0b8e2d3f80b563a9f9 (diff) | |
download | qemu-0e7ce54cf5fb9b7e8d19a5a4eb1facf123edbcef.zip qemu-0e7ce54cf5fb9b7e8d19a5a4eb1facf123edbcef.tar.gz qemu-0e7ce54cf5fb9b7e8d19a5a4eb1facf123edbcef.tar.bz2 |
ide: fold add_status callback into set_inactive
It is now called only after the set_inactive callback. Put the two together.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/ide/pci.c')
-rw-r--r-- | hw/ide/pci.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 1ee8c0a..73267a4 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -152,21 +152,17 @@ static int bmdma_set_unit(IDEDMA *dma, int unit) return 0; } -static int bmdma_add_status(IDEDMA *dma, int status) +static void bmdma_set_inactive(IDEDMA *dma, bool more) { BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma); - bm->status |= status; - return 0; -} - -static void bmdma_set_inactive(IDEDMA *dma) -{ - BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma); - - bm->status &= ~BM_STATUS_DMAING; bm->dma_cb = NULL; bm->unit = -1; + if (more) { + bm->status |= BM_STATUS_DMAING; + } else { + bm->status &= ~BM_STATUS_DMAING; + } } static void bmdma_restart_dma(BMDMAState *bm, enum ide_dma_cmd dma_cmd) @@ -241,7 +237,7 @@ static void bmdma_cancel(BMDMAState *bm) { if (bm->status & BM_STATUS_DMAING) { /* cancel DMA request */ - bmdma_set_inactive(&bm->dma); + bmdma_set_inactive(&bm->dma, false); } } @@ -498,7 +494,6 @@ static const struct IDEDMAOps bmdma_ops = { .prepare_buf = bmdma_prepare_buf, .rw_buf = bmdma_rw_buf, .set_unit = bmdma_set_unit, - .add_status = bmdma_add_status, .set_inactive = bmdma_set_inactive, .restart_cb = bmdma_restart_cb, .reset = bmdma_reset, |