diff options
Diffstat (limited to 'hw/char/serial-isa.c')
-rw-r--r-- | hw/char/serial-isa.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c index 6e7e0dd057..e06a802e24 100644 --- a/hw/char/serial-isa.c +++ b/hw/char/serial-isa.c @@ -120,15 +120,17 @@ type_init(serial_register_types) bool serial_isa_init(ISABus *bus, int index, CharDriverState *chr) { - ISADevice *dev; + DeviceState *dev; + ISADevice *isadev; - dev = isa_try_create(bus, TYPE_ISA_SERIAL); - if (!dev) { + isadev = isa_try_create(bus, TYPE_ISA_SERIAL); + if (!isadev) { return false; } - qdev_prop_set_uint32(&dev->qdev, "index", index); - qdev_prop_set_chr(&dev->qdev, "chardev", chr); - if (qdev_init(&dev->qdev) < 0) { + dev = DEVICE(isadev); + qdev_prop_set_uint32(dev, "index", index); + qdev_prop_set_chr(dev, "chardev", chr); + if (qdev_init(dev) < 0) { return false; } return true; |