From 58cd986422d7353e7fac56969ac59daab3cdca67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 25 Nov 2012 18:13:38 +0100 Subject: kvm/i8254: QOM'ify some more MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce type constant and cast macro to obsolete DO_UPCAST(). Prepares for PIT realizefn. Signed-off-by: Andreas Färber --- include/hw/timer/i8254.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h index 016f990..4349033 100644 --- a/include/hw/timer/i8254.h +++ b/include/hw/timer/i8254.h @@ -38,6 +38,7 @@ typedef struct PITChannelInfo { } PITChannelInfo; #define TYPE_I8254 "isa-pit" +#define TYPE_KVM_I8254 "kvm-pit" static inline ISADevice *pit_init(ISABus *bus, int base, int isa_irq, qemu_irq alt_irq) @@ -57,13 +58,15 @@ static inline ISADevice *pit_init(ISABus *bus, int base, int isa_irq, static inline ISADevice *kvm_pit_init(ISABus *bus, int base) { - ISADevice *dev; + DeviceState *dev; + ISADevice *d; - dev = isa_create(bus, "kvm-pit"); - qdev_prop_set_uint32(&dev->qdev, "iobase", base); - qdev_init_nofail(&dev->qdev); + d = isa_create(bus, TYPE_KVM_I8254); + dev = DEVICE(d); + qdev_prop_set_uint32(dev, "iobase", base); + qdev_init_nofail(dev); - return dev; + return d; } void pit_set_gate(ISADevice *dev, int channel, int val); -- cgit v1.1