summaryrefslogtreecommitdiffstats
path: root/include/hw/timer/i8254.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hw/timer/i8254.h')
-rw-r--r--include/hw/timer/i8254.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h
index 45cb42571f..e75b4a5a08 100644
--- a/include/hw/timer/i8254.h
+++ b/include/hw/timer/i8254.h
@@ -27,6 +27,7 @@
#include "hw/qdev-properties.h"
#include "hw/isa/isa.h"
+#include "qapi/error.h"
#define PIT_FREQ 1193182
@@ -54,10 +55,10 @@ static inline ISADevice *i8254_pit_init(ISABus *bus, int base, int isa_irq,
DeviceState *dev;
ISADevice *d;
- d = isa_create(bus, TYPE_I8254);
+ d = isa_new(TYPE_I8254);
dev = DEVICE(d);
qdev_prop_set_uint32(dev, "iobase", base);
- qdev_init_nofail(dev);
+ isa_realize_and_unref(d, bus, &error_fatal);
qdev_connect_gpio_out(dev, 0,
isa_irq >= 0 ? isa_get_irq(d, isa_irq) : alt_irq);
@@ -69,10 +70,10 @@ static inline ISADevice *kvm_pit_init(ISABus *bus, int base)
DeviceState *dev;
ISADevice *d;
- d = isa_create(bus, TYPE_KVM_I8254);
+ d = isa_new(TYPE_KVM_I8254);
dev = DEVICE(d);
qdev_prop_set_uint32(dev, "iobase", base);
- qdev_init_nofail(dev);
+ isa_realize_and_unref(d, bus, &error_fatal);
return d;
}