From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A45B0C61DA4 for ; Mon, 6 Feb 2023 13:02:10 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP18A-0006zU-FJ; Mon, 06 Feb 2023 08:01:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP181-0006uk-0P for qemu-devel@nongnu.org; Mon, 06 Feb 2023 08:01:50 -0500 Received: from hsmtpd-def.xspmail.jp ([202.238.198.243]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP17z-00066s-43 for qemu-devel@nongnu.org; Mon, 06 Feb 2023 08:01:48 -0500 X-Country-Code: JP Received: from sakura.ysato.name (ik1-413-38519.vs.sakura.ne.jp [153.127.30.23]) by hsmtpd-out-2.asahinet.cluster.xspmail.jp (Halon) with ESMTPA id a5dd0592-ab2b-4c17-a294-354aa4a0a4e9; Mon, 06 Feb 2023 22:01:41 +0900 (JST) Received: from SIOS1075.ysato.ml (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by sakura.ysato.name (Postfix) with ESMTPSA id 349111C012C; Mon, 6 Feb 2023 22:01:39 +0900 (JST) Date: Mon, 06 Feb 2023 22:01:36 +0900 Message-ID: <87wn4vrlqn.wl-ysato@users.sourceforge.jp> From: Yoshinori Sato To: Philippe =?ISO-8859-1?Q?Mathieu-Daud=E9?= Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org Subject: Re: [PATCH 18/19] hw/rx: Set QDev properties using QDev API In-Reply-To: <20230203180914.49112-19-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> <20230203180914.49112-19-philmd@linaro.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Received-SPF: softfail client-ip=202.238.198.243; envelope-from=ysato@users.sourceforge.jp; helo=hsmtpd-def.xspmail.jp X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Sat, 04 Feb 2023 03:09:13 +0900, Philippe Mathieu-Daud=E9 wrote: >=20 > No need to use the low-level QOM API when an object > inherits from QDev. Directly use the QDev API to set > its properties. >=20 > Signed-off-by: Philippe Mathieu-Daud=E9 > --- > hw/rx/rx-gdbsim.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) >=20 > 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) > =20 > /* Initialize MCU */ > object_initialize_child(OBJECT(machine), "mcu", &s->mcu, rxc->mcu_na= me); > - 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 !=3D 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 != =3D NULL); > =20 > if (!kernel_filename) { > if (machine->firmware) { > --=20 > 2.38.1 >=20 Reviewed-by: Yoshinori Sato --=20 Yosinori Sato