diff mbox series

[4/9] hw/arm/tosa: Convert TYPE_TOSA_MISC_GPIO from SysBus to QDev

Message ID 20230109092617.80224-5-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
Drop the pointless TosaMiscGPIOState structure definition,
since it defaults to the size of the parent's type.

Nothing in TYPE_TOSA_MISC_GPIO access the SysBus API,
convert it to a plain QDev.

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

Patch

diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
index d5a6763cf9..ec0db24e8f 100644
--- a/hw/arm/tosa.c
+++ b/hw/arm/tosa.c
@@ -78,10 +78,6 @@  static void tosa_microdrive_attach(PXA2xxState *cpu)
 #define TYPE_TOSA_MISC_GPIO "tosa-misc-gpio"
 OBJECT_DECLARE_SIMPLE_TYPE(TosaMiscGPIOState, TOSA_MISC_GPIO)
 
-struct TosaMiscGPIOState {
-    SysBusDevice parent_obj;
-};
-
 static void tosa_reset(void *opaque, int line, int level)
 {
     if (level) {
@@ -104,7 +100,7 @@  static void tosa_gpio_setup(PXA2xxState *cpu,
     DeviceState *misc_gpio;
     LEDState *led[4];
 
-    misc_gpio = sysbus_create_simple(TYPE_TOSA_MISC_GPIO, -1, NULL);
+    misc_gpio = qdev_create_simple(TYPE_TOSA_MISC_GPIO, &error_fatal);
 
     /* MMC/SD host */
     pxa2xx_mmci_handlers(cpu->mmc,
@@ -307,8 +303,7 @@  static const TypeInfo tosa_ssp_info = {
 
 static const TypeInfo tosa_misc_gpio_info = {
     .name          = TYPE_TOSA_MISC_GPIO,
-    .parent        = TYPE_SYS_BUS_DEVICE,
-    .instance_size = sizeof(TosaMiscGPIOState),
+    .parent        = TYPE_DEVICE,
     .instance_init = tosa_misc_gpio_init,
     /*
      * No class init required: device has no internal state so does not