aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-11-25 18:05:53 +0100
committerAndreas Färber <afaerber@suse.de>2013-06-07 14:55:16 +0200
commit3afe7e14a42309578d324df5fe1b303a496a8466 (patch)
tree6103493c2f3fd775c385c86ece9feab93dfd643f /include
parentdb895a1e6a97e919f9b86d60c969377357b05066 (diff)
i8254: QOM'ify some more
Introduce type constant and avoid DO_UPCAST(). Prepares for PIT realizefn. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/hw/timer/i8254.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h
index 75bb530ad9..016f990440 100644
--- a/include/hw/timer/i8254.h
+++ b/include/hw/timer/i8254.h
@@ -37,18 +37,22 @@ typedef struct PITChannelInfo {
int out;
} PITChannelInfo;
+#define TYPE_I8254 "isa-pit"
+
static inline ISADevice *pit_init(ISABus *bus, int base, int isa_irq,
qemu_irq alt_irq)
{
- ISADevice *dev;
+ DeviceState *dev;
+ ISADevice *d;
- dev = isa_create(bus, "isa-pit");
- qdev_prop_set_uint32(&dev->qdev, "iobase", base);
- qdev_init_nofail(&dev->qdev);
- qdev_connect_gpio_out(&dev->qdev, 0,
- isa_irq >= 0 ? isa_get_irq(dev, isa_irq) : alt_irq);
+ d = isa_create(bus, TYPE_I8254);
+ dev = DEVICE(d);
+ qdev_prop_set_uint32(dev, "iobase", base);
+ qdev_init_nofail(dev);
+ qdev_connect_gpio_out(dev, 0,
+ isa_irq >= 0 ? isa_get_irq(d, isa_irq) : alt_irq);
- return dev;
+ return d;
}
static inline ISADevice *kvm_pit_init(ISABus *bus, int base)