ide: simplify start_transfer callbacks
Drop the unused return value and make the callback optional. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
c039cb1e5a
commit
446351236b
|
@ -991,7 +991,7 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DMA dev <-> ram */
|
/* DMA dev <-> ram */
|
||||||
static int ahci_start_transfer(IDEDMA *dma)
|
static void ahci_start_transfer(IDEDMA *dma)
|
||||||
{
|
{
|
||||||
AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma);
|
AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma);
|
||||||
IDEState *s = &ad->port.ifs[0];
|
IDEState *s = &ad->port.ifs[0];
|
||||||
|
@ -1041,8 +1041,6 @@ out:
|
||||||
/* done with DMA */
|
/* done with DMA */
|
||||||
ahci_trigger_irq(ad->hba, ad, PORT_IRQ_STAT_DSS);
|
ahci_trigger_irq(ad->hba, ad, PORT_IRQ_STAT_DSS);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ahci_start_dma(IDEDMA *dma, IDEState *s,
|
static void ahci_start_dma(IDEDMA *dma, IDEState *s,
|
||||||
|
|
|
@ -434,7 +434,9 @@ void ide_transfer_start(IDEState *s, uint8_t *buf, int size,
|
||||||
if (!(s->status & ERR_STAT)) {
|
if (!(s->status & ERR_STAT)) {
|
||||||
s->status |= DRQ_STAT;
|
s->status |= DRQ_STAT;
|
||||||
}
|
}
|
||||||
s->bus->dma->ops->start_transfer(s->bus->dma);
|
if (s->bus->dma->ops->start_transfer) {
|
||||||
|
s->bus->dma->ops->start_transfer(s->bus->dma);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ide_transfer_stop(IDEState *s)
|
void ide_transfer_stop(IDEState *s)
|
||||||
|
@ -2207,11 +2209,6 @@ static void ide_nop_start(IDEDMA *dma, IDEState *s,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ide_nop(IDEDMA *dma)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int ide_nop_int(IDEDMA *dma, int x)
|
static int ide_nop_int(IDEDMA *dma, int x)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2223,7 +2220,6 @@ static void ide_nop_restart(void *opaque, int x, RunState y)
|
||||||
|
|
||||||
static const IDEDMAOps ide_dma_nop_ops = {
|
static const IDEDMAOps ide_dma_nop_ops = {
|
||||||
.start_dma = ide_nop_start,
|
.start_dma = ide_nop_start,
|
||||||
.start_transfer = ide_nop,
|
|
||||||
.prepare_buf = ide_nop_int,
|
.prepare_buf = ide_nop_int,
|
||||||
.rw_buf = ide_nop_int,
|
.rw_buf = ide_nop_int,
|
||||||
.set_unit = ide_nop_int,
|
.set_unit = ide_nop_int,
|
||||||
|
|
|
@ -321,7 +321,6 @@ typedef void EndTransferFunc(IDEState *);
|
||||||
|
|
||||||
typedef void DMAStartFunc(IDEDMA *, IDEState *, BlockDriverCompletionFunc *);
|
typedef void DMAStartFunc(IDEDMA *, IDEState *, BlockDriverCompletionFunc *);
|
||||||
typedef void DMAVoidFunc(IDEDMA *);
|
typedef void DMAVoidFunc(IDEDMA *);
|
||||||
typedef int DMAFunc(IDEDMA *);
|
|
||||||
typedef int DMAIntFunc(IDEDMA *, int);
|
typedef int DMAIntFunc(IDEDMA *, int);
|
||||||
typedef void DMARestartFunc(void *, int, RunState);
|
typedef void DMARestartFunc(void *, int, RunState);
|
||||||
|
|
||||||
|
@ -428,7 +427,7 @@ struct IDEState {
|
||||||
|
|
||||||
struct IDEDMAOps {
|
struct IDEDMAOps {
|
||||||
DMAStartFunc *start_dma;
|
DMAStartFunc *start_dma;
|
||||||
DMAFunc *start_transfer;
|
DMAVoidFunc *start_transfer;
|
||||||
DMAIntFunc *prepare_buf;
|
DMAIntFunc *prepare_buf;
|
||||||
DMAIntFunc *rw_buf;
|
DMAIntFunc *rw_buf;
|
||||||
DMAIntFunc *set_unit;
|
DMAIntFunc *set_unit;
|
||||||
|
|
|
@ -545,11 +545,6 @@ static void macio_ide_reset(DeviceState *dev)
|
||||||
ide_bus_reset(&d->bus);
|
ide_bus_reset(&d->bus);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ide_nop(IDEDMA *dma)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int ide_nop_int(IDEDMA *dma, int x)
|
static int ide_nop_int(IDEDMA *dma, int x)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -571,7 +566,6 @@ static void ide_dbdma_start(IDEDMA *dma, IDEState *s,
|
||||||
|
|
||||||
static const IDEDMAOps dbdma_ops = {
|
static const IDEDMAOps dbdma_ops = {
|
||||||
.start_dma = ide_dbdma_start,
|
.start_dma = ide_dbdma_start,
|
||||||
.start_transfer = ide_nop,
|
|
||||||
.prepare_buf = ide_nop_int,
|
.prepare_buf = ide_nop_int,
|
||||||
.rw_buf = ide_nop_int,
|
.rw_buf = ide_nop_int,
|
||||||
.set_unit = ide_nop_int,
|
.set_unit = ide_nop_int,
|
||||||
|
|
|
@ -264,11 +264,6 @@ static void bmdma_reset(IDEDMA *dma)
|
||||||
bm->nsector = 0;
|
bm->nsector = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bmdma_start_transfer(IDEDMA *dma)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void bmdma_irq(void *opaque, int n, int level)
|
static void bmdma_irq(void *opaque, int n, int level)
|
||||||
{
|
{
|
||||||
BMDMAState *bm = opaque;
|
BMDMAState *bm = opaque;
|
||||||
|
@ -500,7 +495,6 @@ void pci_ide_create_devs(PCIDevice *dev, DriveInfo **hd_table)
|
||||||
|
|
||||||
static const struct IDEDMAOps bmdma_ops = {
|
static const struct IDEDMAOps bmdma_ops = {
|
||||||
.start_dma = bmdma_start_dma,
|
.start_dma = bmdma_start_dma,
|
||||||
.start_transfer = bmdma_start_transfer,
|
|
||||||
.prepare_buf = bmdma_prepare_buf,
|
.prepare_buf = bmdma_prepare_buf,
|
||||||
.rw_buf = bmdma_rw_buf,
|
.rw_buf = bmdma_rw_buf,
|
||||||
.set_unit = bmdma_set_unit,
|
.set_unit = bmdma_set_unit,
|
||||||
|
|
Loading…
Reference in New Issue