ps2: implement ps2_reset() for the PS2_DEVICE QOM type based upon ps2_common_reset()

The functionality of ps2_common_reset() can be moved into a new ps2_reset() function
for the PS2_DEVICE QOM type. Update PS2DeviceClass to hold a reference to the parent
reset function and update the PS2_KBD_DEVICE and PS2_MOUSE_DEVICE types to use
device_class_set_parent_reset() accordingly.

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-9-mark.cave-ayland@ilande.co.uk>
This commit is contained in:
Mark Cave-Ayland 2022-06-24 14:40:23 +01:00
parent 494145b286
commit 108cb22e48
2 changed files with 37 additions and 13 deletions

View file

@ -35,6 +35,8 @@
struct PS2DeviceClass {
SysBusDeviceClass parent_class;
DeviceReset parent_reset;
};
/*