diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2013-06-15 10:53:44 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2013-06-15 10:53:44 +0000 |
commit | 371a775dc18ece3ff7d77328d1ee28cb2d473706 (patch) | |
tree | 328c5e856f25c5f0176d9361b641e8061e093ae2 /hw/dma | |
parent | 22bfa16ed3d4c9d534dcfe6f2381a654f32296b9 (diff) | |
parent | fef7fbc92496f5f6d2b7395263830bce15ebf410 (diff) |
Merge branch 'realize-isa.v2' of git://github.com/afaerber/qemu-cpu
* 'realize-isa.v2' of git://github.com/afaerber/qemu-cpu:
qdev: Drop FROM_QBUS() macro
isa: QOM'ify ISADevice
isa: QOM'ify ISABus
i8259: Convert PICCommonState to use QOM realizefn
kvm/i8259: QOM'ify some more
i8259: QOM'ify some more
i8254: Convert PITCommonState to QOM realizefn
kvm/i8254: QOM'ify some more
i8254: QOM'ify some more
isa: Use realizefn for ISADevice
cs4231a: QOM'ify some more
gus: QOM'ify some more
Diffstat (limited to 'hw/dma')
-rw-r--r-- | hw/dma/i82374.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index f3d1924109..6192780fda 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -98,7 +98,7 @@ static uint32_t i82374_read_descriptor(void *opaque, uint32_t nport) return val; } -static void i82374_init(I82374State *s) +static void i82374_realize(I82374State *s, Error **errp) { DMA_init(1, &s->out); memset(s->commands, 0, sizeof(s->commands)); @@ -124,7 +124,7 @@ static const VMStateDescription vmstate_isa_i82374 = { }, }; -static int i82374_isa_init(ISADevice *dev) +static void i82374_isa_realize(DeviceState *dev, Error **errp) { ISAi82374State *isa = I82374(dev); I82374State *s = &isa->state; @@ -135,11 +135,9 @@ static int i82374_isa_init(ISADevice *dev) register_ioport_write(isa->iobase + 0x20, 0x20, 1, i82374_write_descriptor, s); register_ioport_read(isa->iobase + 0x20, 0x20, 1, i82374_read_descriptor, s); - i82374_init(s); + i82374_realize(s, errp); - qdev_init_gpio_out(&dev->qdev, &s->out, 1); - - return 0; + qdev_init_gpio_out(dev, &s->out, 1); } static Property i82374_properties[] = { @@ -149,10 +147,9 @@ static Property i82374_properties[] = { static void i82374_class_init(ObjectClass *klass, void *data) { - ISADeviceClass *k = ISA_DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); - k->init = i82374_isa_init; + dc->realize = i82374_isa_realize; dc->vmsd = &vmstate_isa_i82374; dc->props = i82374_properties; } |