diff options
author | Andreas Färber | 2013-06-07 13:49:13 +0200 |
---|---|---|
committer | Andreas Färber | 2013-06-07 14:55:33 +0200 |
commit | 4a17cc4f285d7ffe41847bf728cd88c736237416 (patch) | |
tree | 8660ca33cdb5f9852502a9287587ff27b5a529bc /include/hw/i386 | |
parent | isa: QOM'ify ISABus (diff) | |
download | qemu-4a17cc4f285d7ffe41847bf728cd88c736237416.tar.gz qemu-4a17cc4f285d7ffe41847bf728cd88c736237416.tar.xz qemu-4a17cc4f285d7ffe41847bf728cd88c736237416.zip |
isa: QOM'ify ISADevice
Rename its parent field and use DEVICE() where necessary.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include/hw/i386')
-rw-r--r-- | include/hw/i386/pc.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 61540587a4..5d883eb647 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -14,15 +14,17 @@ /* parallel.c */ static inline bool parallel_init(ISABus *bus, int index, CharDriverState *chr) { - ISADevice *dev; + DeviceState *dev; + ISADevice *isadev; - dev = isa_try_create(bus, "isa-parallel"); - if (!dev) { + isadev = isa_try_create(bus, "isa-parallel"); + 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; @@ -155,18 +157,20 @@ int isa_vga_mm_init(hwaddr vram_base, /* ne2000.c */ static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd) { - ISADevice *dev; + DeviceState *dev; + ISADevice *isadev; qemu_check_nic_model(nd, "ne2k_isa"); - dev = isa_try_create(bus, "ne2k_isa"); - if (!dev) { + isadev = isa_try_create(bus, "ne2k_isa"); + if (!isadev) { return false; } - qdev_prop_set_uint32(&dev->qdev, "iobase", base); - qdev_prop_set_uint32(&dev->qdev, "irq", irq); - qdev_set_nic_properties(&dev->qdev, nd); - qdev_init_nofail(&dev->qdev); + dev = DEVICE(isadev); + qdev_prop_set_uint32(dev, "iobase", base); + qdev_prop_set_uint32(dev, "irq", irq); + qdev_set_nic_properties(dev, nd); + qdev_init_nofail(dev); return true; } |