diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2022-06-24 14:41:00 +0100 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2022-06-26 18:40:12 +0100 |
commit | 1702627c3329e6f43b92addc6eb16fc420a4cf18 (patch) | |
tree | 76b705f0eeefe7bde63b518e688bf0aaceb6edd5 /hw/input | |
parent | 42119fdb2e851b2a0a6cc09197c33ad943dcb6e9 (diff) | |
download | qemu-1702627c3329e6f43b92addc6eb16fc420a4cf18.zip qemu-1702627c3329e6f43b92addc6eb16fc420a4cf18.tar.gz qemu-1702627c3329e6f43b92addc6eb16fc420a4cf18.tar.bz2 |
lasips2: implement lasips2_realize()
Move ps2_kbd_init() and ps2_mouse_init() from lasips2_initfn() to lasips2_realize.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Helge Deller <deller@gmx.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220624134109.881989-46-mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/input')
-rw-r--r-- | hw/input/lasips2.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 81beb5b..4940519 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -256,13 +256,17 @@ LASIPS2State *lasips2_initfn(hwaddr base, qemu_irq irq) s = LASIPS2(dev); s->irq = irq; + return s; +} + +static void lasips2_realize(DeviceState *dev, Error **errp) +{ + LASIPS2State *s = LASIPS2(dev); - vmstate_register(NULL, base, &vmstate_lasips2, s); + vmstate_register(NULL, s->base, &vmstate_lasips2, s); s->kbd.dev = ps2_kbd_init(lasips2_port_set_irq, &s->kbd); s->mouse.dev = ps2_mouse_init(lasips2_port_set_irq, &s->mouse); - - return s; } static void lasips2_init(Object *obj) @@ -292,6 +296,7 @@ static void lasips2_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + dc->realize = lasips2_realize; device_class_set_props(dc, lasips2_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } |