From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Bastian Koppelmann" <kbastian@mail.uni-paderborn.de>
Subject: [PULL 09/32] hw/tricore/testboard: Use qdev_new() instead of QOM basic API
Date: Thu, 22 Feb 2024 13:55:11 +0100 [thread overview]
Message-ID: <20240222125517.67131-4-philmd@linaro.org> (raw)
In-Reply-To: <20240222125517.67131-1-philmd@linaro.org>
Prefer QDev API for QDev objects, avoid the underlying QOM layer.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Message-Id: <20240216110313.17039-5-philmd@linaro.org>
---
include/hw/tricore/tricore_testdevice.h | 3 ---
hw/tricore/tricore_testboard.c | 4 +---
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/include/hw/tricore/tricore_testdevice.h b/include/hw/tricore/tricore_testdevice.h
index 8b4fe15f24..2c57b62f22 100644
--- a/include/hw/tricore/tricore_testdevice.h
+++ b/include/hw/tricore/tricore_testdevice.h
@@ -25,12 +25,9 @@
OBJECT_CHECK(TriCoreTestDeviceState, (obj), TYPE_TRICORE_TESTDEVICE)
typedef struct {
- /* <private> */
SysBusDevice parent_obj;
- /* <public> */
MemoryRegion iomem;
-
} TriCoreTestDeviceState;
#endif
diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c
index b6810e3be0..c29db8b451 100644
--- a/hw/tricore/tricore_testboard.c
+++ b/hw/tricore/tricore_testboard.c
@@ -89,9 +89,7 @@ static void tricore_testboard_init(MachineState *machine, int board_id)
memory_region_add_subregion(sysmem, 0xf0050000, pcp_data);
memory_region_add_subregion(sysmem, 0xf0060000, pcp_text);
- test_dev = g_new(TriCoreTestDeviceState, 1);
- object_initialize(test_dev, sizeof(TriCoreTestDeviceState),
- TYPE_TRICORE_TESTDEVICE);
+ test_dev = TRICORE_TESTDEVICE(qdev_new(TYPE_TRICORE_TESTDEVICE));
memory_region_add_subregion(sysmem, 0xf0000000, &test_dev->iomem);
--
2.41.0
next prev parent reply other threads:[~2024-02-22 12:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 12:55 [PULL 02/32] hw/sysbus: Inline and remove sysbus_add_io() Philippe Mathieu-Daudé
2024-02-22 12:55 ` [PULL 07/32] hw/ppc/spapr_cpu: Use qdev_is_realized() instead of QOM API Philippe Mathieu-Daudé
2024-02-22 12:55 ` [PULL 08/32] hw/ppc/pnv_bmc: Use qdev_new() " Philippe Mathieu-Daudé
2024-02-22 12:55 ` Philippe Mathieu-Daudé [this message]
2024-02-22 12:55 ` [PULL 19/32] hw/i386/pc_sysfw: Use qdev_is_realized() " Philippe Mathieu-Daudé
2024-02-22 12:55 ` [PULL 22/32] hw/acpi: Include missing 'qapi/qapi-types-acpi.h' generated header Philippe Mathieu-Daudé
2024-02-22 12:55 ` [PULL 23/32] hw/acpi/cpu: Use CPUState typedef Philippe Mathieu-Daudé
2024-02-22 12:55 ` [PULL 24/32] hw/acpi/ich9_tco: Include missing 'migration/vmstate.h' header Philippe Mathieu-Daudé
2024-02-22 12:55 ` [PULL 32/32] hw/sparc/leon3: Fix wrong usage of DO_UPCAST macro Philippe Mathieu-Daudé
2024-02-22 12:58 ` [PULL v2 00/32] Misc HW patches for 2024-02-22 Philippe Mathieu-Daudé
2024-02-23 9:43 ` 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=20240222125517.67131-4-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=kbastian@mail.uni-paderborn.de \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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).