qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 18/19] hw/rx: Set QDev properties using QDev API


From: Yoshinori Sato
Subject: Re: [PATCH 18/19] hw/rx: Set QDev properties using QDev API
Date: Mon, 06 Feb 2023 22:01:36 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

On Sat, 04 Feb 2023 03:09:13 +0900,
Philippe Mathieu-Daudé wrote:
> 
> 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
> 

Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp>

-- 
Yosinori Sato



reply via email to

[Prev in Thread] Current Thread [Next in Thread]