diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2011-02-05 19:37:40 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2011-02-20 09:32:50 +0000 |
commit | e22cf21efdc5f25fb9ba136cba7acb71aa379ea7 (patch) | |
tree | 779320539ee9d91fbaf98acfce00a6aace73232f /hw/pc.h | |
parent | cd1b8a8b0d5951fb3a575a13bfd3aa3f7018ef1f (diff) |
serial: refactor device creation
Turn serial_init into an inline function.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/pc.h')
-rw-r--r-- | hw/pc.h | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -17,7 +17,19 @@ SerialState *serial_mm_init (target_phys_addr_t base, int it_shift, qemu_irq irq, int baudbase, CharDriverState *chr, int ioregister, int be); -SerialState *serial_isa_init(int index, CharDriverState *chr); +static inline bool serial_isa_init(int index, CharDriverState *chr) +{ + ISADevice *dev; + + dev = isa_create("isa-serial"); + qdev_prop_set_uint32(&dev->qdev, "index", index); + qdev_prop_set_chr(&dev->qdev, "chardev", chr); + if (qdev_init(&dev->qdev) < 0) { + return false; + } + return true; +} + void serial_set_frequency(SerialState *s, uint32_t frequency); /* parallel.c */ |