[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/19] hw/rx: Set QDev properties using QDev API
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 18/19] hw/rx: Set QDev properties using QDev API |
Date: |
Fri, 3 Feb 2023 19:09:13 +0100 |
No need to use the low-level QOM API when an object
inherits from QDev. Directly use the QDev API to set
its properties.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/rx/rx-gdbsim.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c
index 47c17026c7..5d50f36877 100644
--- a/hw/rx/rx-gdbsim.c
+++ b/hw/rx/rx-gdbsim.c
@@ -21,6 +21,7 @@
#include "qemu/error-report.h"
#include "qemu/guest-random.h"
#include "qapi/error.h"
+#include "hw/qdev-properties.h"
#include "hw/loader.h"
#include "hw/rx/rx62n.h"
#include "sysemu/qtest.h"
@@ -99,12 +100,10 @@ static void rx_gdbsim_init(MachineState *machine)
/* Initialize MCU */
object_initialize_child(OBJECT(machine), "mcu", &s->mcu, rxc->mcu_name);
- object_property_set_link(OBJECT(&s->mcu), "main-bus", OBJECT(sysmem),
- &error_abort);
- object_property_set_uint(OBJECT(&s->mcu), "xtal-frequency-hz",
- rxc->xtal_freq_hz, &error_abort);
- object_property_set_bool(OBJECT(&s->mcu), "load-kernel",
- kernel_filename != NULL, &error_abort);
+ qdev_prop_set_link(DEVICE(&s->mcu), "main-bus", OBJECT(sysmem));
+ qdev_prop_set_uint32(DEVICE(&s->mcu), "xtal-frequency-hz",
+ rxc->xtal_freq_hz);
+ qdev_prop_set_bit(DEVICE(&s->mcu), "load-kernel", kernel_filename != NULL);
if (!kernel_filename) {
if (machine->firmware) {
--
2.38.1
- [PATCH 10/19] hw/avr: Set QDev properties using QDev API, (continued)
- [PATCH 10/19] hw/avr: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 11/19] hw/hppa: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [RFC PATCH 12/19] hw/i386: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 13/19] hw/m68k: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 14/19] hw/microblaze: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [RFC PATCH 15/19] hw/mips: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 16/19] hw/nios2: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [RFC PATCH 17/19] hw/riscv: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 18/19] hw/rx: Set QDev properties using QDev API,
Philippe Mathieu-Daudé <=
- [PATCH 19/19] hw/sparc: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- Re: [PATCH 00/19] hw: Set QDev properties using QDev API (part 1/3), Philippe Mathieu-Daudé, 2023/02/03