aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-06-24 14:40:28 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-06-26 18:40:11 +0100
commit97259e70cbc0b874a523302960ae70fd184621ae (patch)
tree6dcc28828e0a12d198e48f034c1b48ce56b9f92f /hw
parentf055f5075ab6778bddf2242c232b35b4466510c0 (diff)
downloadqemu-97259e70cbc0b874a523302960ae70fd184621ae.zip
qemu-97259e70cbc0b874a523302960ae70fd184621ae.tar.gz
qemu-97259e70cbc0b874a523302960ae70fd184621ae.tar.bz2
ps2: don't use vmstate_register() in ps2_mouse_init()
Since PS2_MOUSE_DEVICE is a qdev device then vmstate_ps2_mouse can be registered using the DeviceClass vmsd field instead. There is no need to use qdev_set_legacy_instance_id() to ensure migration compatibility since the first 2 parameters to vmstate_register() are NULL and 0 respectively. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-14-mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw')
-rw-r--r--hw/input/ps2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 97e9172..9c046ac 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -1262,7 +1262,6 @@ void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg)
trace_ps2_mouse_init(s);
ps2->update_irq = update_irq;
ps2->update_arg = update_arg;
- vmstate_register(NULL, 0, &vmstate_ps2_mouse, s);
return s;
}
@@ -1291,6 +1290,7 @@ static void ps2_mouse_class_init(ObjectClass *klass, void *data)
dc->realize = ps2_mouse_realize;
device_class_set_parent_reset(dc, ps2_mouse_reset,
&ps2dc->parent_reset);
+ dc->vmsd = &vmstate_ps2_mouse;
}
static const TypeInfo ps2_mouse_info = {