diff mbox series

[8/9] hw/arm/tosa: Convert TYPE_SPITZ_MISC_GPIO from SysBus to QDev

Message ID 20230109092617.80224-9-philmd@linaro.org (mailing list archive)
State New, archived
Headers show
Series hw: Convert simple devices from SysBus to QDev | expand

Commit Message

Philippe Mathieu-Daudé Jan. 9, 2023, 9:26 a.m. UTC
Nothing in TYPE_SPITZ_MISC_GPIO access the SysBus API,
convert it to a plain QDev.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/arm/spitz.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index 6605d658ed..31445329ff 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -819,7 +819,9 @@  static void spitz_akita_i2c_setup(PXA2xxState *cpu)
 OBJECT_DECLARE_SIMPLE_TYPE(SpitzMiscGPIOState, SPITZ_MISC_GPIO)
 
 struct SpitzMiscGPIOState {
-    SysBusDevice parent_obj;
+    /*< private >*/
+    DeviceState parent_obj;
+    /*< public >*/
 
     qemu_irq adc_value;
 };
@@ -883,7 +885,9 @@  static void spitz_misc_gpio_init(Object *obj)
 
 static void spitz_scoop_gpio_setup(SpitzMachineState *sms)
 {
-    DeviceState *miscdev = sysbus_create_simple(TYPE_SPITZ_MISC_GPIO, -1, NULL);
+    DeviceState *miscdev;
+
+    miscdev = qdev_create_simple(TYPE_SPITZ_MISC_GPIO, &error_fatal);
 
     sms->misc_gpio = miscdev;
 
@@ -1260,7 +1264,7 @@  static const TypeInfo spitz_lcdtg_info = {
 
 static const TypeInfo spitz_misc_gpio_info = {
     .name = TYPE_SPITZ_MISC_GPIO,
-    .parent = TYPE_SYS_BUS_DEVICE,
+    .parent = TYPE_DEVICE,
     .instance_size = sizeof(SpitzMiscGPIOState),
     .instance_init = spitz_misc_gpio_init,
     /*