From cd369c4634e58a99fb82f076e6117bfdf0012b8e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 20 Dec 2010 13:45:48 +0100 Subject: ide: factor dma handling helpers Factor the DMA I/O path that is duplicated between read and write commands, into common helpers using the s->is_read flag added for the macio ATA controller. Signed-off-by: Christoph Hellwig Signed-off-by: Kevin Wolf --- hw/ide/pci.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'hw/ide/pci.c') diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 510b2de597..987caffa3a 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -178,14 +178,9 @@ static void bmdma_restart_dma(BMDMAState *bm, int is_read) s->io_buffer_index = 0; s->io_buffer_size = 0; s->nsector = bm->nsector; + s->is_read = is_read; bm->cur_addr = bm->addr; - - if (is_read) { - bm->dma_cb = ide_read_dma_cb; - } else { - bm->dma_cb = ide_write_dma_cb; - } - + bm->dma_cb = ide_dma_cb; bmdma_start_dma(&bm->dma, s, bm->dma_cb); } -- cgit v1.2.1