qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Jan Kiszka" <jan.kiszka@web.de>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu-arm@nongnu.org, "Eduardo Habkost" <eduardo@habkost.net>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 5/9] hw/arm/palm: Convert TYPE_PALM_MISC_GPIO from SysBus to QDev
Date: Mon,  9 Jan 2023 10:26:13 +0100	[thread overview]
Message-ID: <20230109092617.80224-6-philmd@linaro.org> (raw)
In-Reply-To: <20230109092617.80224-1-philmd@linaro.org>

Drop the pointless PalmMiscGPIOState structure definition,
since it defaults to the size of the parent's type.

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

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

diff --git a/hw/arm/palm.c b/hw/arm/palm.c
index 68e11dd1ec..912164e93f 100644
--- a/hw/arm/palm.c
+++ b/hw/arm/palm.c
@@ -134,10 +134,6 @@ static void palmte_button_event(void *opaque, int keycode)
 #define TYPE_PALM_MISC_GPIO "palm-misc-gpio"
 OBJECT_DECLARE_SIMPLE_TYPE(PalmMiscGPIOState, PALM_MISC_GPIO)
 
-struct PalmMiscGPIOState {
-    SysBusDevice parent_obj;
-};
-
 static void palmte_onoff_gpios(void *opaque, int line, int level)
 {
     switch (line) {
@@ -174,8 +170,7 @@ static void palm_misc_gpio_init(Object *obj)
 
 static const TypeInfo palm_misc_gpio_info = {
     .name = TYPE_PALM_MISC_GPIO,
-    .parent = TYPE_SYS_BUS_DEVICE,
-    .instance_size = sizeof(PalmMiscGPIOState),
+    .parent = TYPE_DEVICE,
     .instance_init = palm_misc_gpio_init,
     /*
      * No class init required: device has no internal state so does not
@@ -187,7 +182,7 @@ static void palmte_gpio_setup(struct omap_mpu_state_s *cpu)
 {
     DeviceState *misc_gpio;
 
-    misc_gpio = sysbus_create_simple(TYPE_PALM_MISC_GPIO, -1, NULL);
+    misc_gpio = qdev_create_simple(TYPE_PALM_MISC_GPIO, &error_fatal);
 
     omap_mmc_handlers(cpu->mmc,
                     qdev_get_gpio_in(cpu->gpio, PALMTE_MMC_WP_GPIO),
-- 
2.38.1



  parent reply	other threads:[~2023-01-09  9:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09  9:26 [PATCH 0/9] hw: Convert simple devices from SysBus to QDev Philippe Mathieu-Daudé
2023-01-09  9:26 ` [PATCH 1/9] hw/arm/musicpal: Remove unused dummy MemoryRegion Philippe Mathieu-Daudé
2023-01-09 17:13   ` Richard Henderson
2023-01-09  9:26 ` [PATCH 2/9] qdev: Add qdev_create_simple() helper Philippe Mathieu-Daudé
2023-01-09  9:26 ` [PATCH 3/9] hw/i2c/bitbang_i2c: Convert TYPE_GPIO_I2C from SysBus to QDev Philippe Mathieu-Daudé
2023-01-09  9:26 ` [PATCH 4/9] hw/arm/tosa: Convert TYPE_TOSA_MISC_GPIO " Philippe Mathieu-Daudé
2023-01-09  9:26 ` Philippe Mathieu-Daudé [this message]
2023-01-09  9:26 ` [PATCH 6/9] hw/arm/musicpal: Convert TYPE_MUSICPAL_KEY " Philippe Mathieu-Daudé
2023-01-09  9:26 ` [PATCH 7/9] hw/arm/spitz: Convert TYPE_SPITZ_KEYBOARD " Philippe Mathieu-Daudé
2023-01-09  9:26 ` [PATCH 8/9] hw/arm/tosa: Convert TYPE_SPITZ_MISC_GPIO " Philippe Mathieu-Daudé
2023-01-09  9:26 ` [PATCH 9/9] hw/i386/kvm: Convert TYPE_KVM_CLOCK " Philippe Mathieu-Daudé
2023-01-09 11:06 ` [PATCH 0/9] hw: Convert simple devices " Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230109092617.80224-6-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=jan.kiszka@web.de \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).