From nobody Tue Feb 10 19:53:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1542987938172819.077975242599; Fri, 23 Nov 2018 07:45:38 -0800 (PST) Received: from localhost ([::1]:53104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQDe5-0001Hh-1R for importer@patchew.org; Fri, 23 Nov 2018 10:45:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQDQD-0004t2-Vf for qemu-devel@nongnu.org; Fri, 23 Nov 2018 10:31:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQDQ6-0005Mu-SP for qemu-devel@nongnu.org; Fri, 23 Nov 2018 10:31:09 -0500 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:24231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQDQ5-000594-CZ for qemu-devel@nongnu.org; Fri, 23 Nov 2018 10:31:02 -0500 Received: from spf.mail.chinamobile.com (unknown[172.16.121.17]) by rmmx-syy-dmz-app04-12004 (RichMail) with SMTP id 2ee45bf81d307a6-012d6; Fri, 23 Nov 2018 23:30:56 +0800 (CST) Received: from localhost.localdomain (unknown[112.25.154.149]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee95bf81d22571-bd3d6; Fri, 23 Nov 2018 23:30:56 +0800 (CST) X-RM-TRANSID: 2ee45bf81d307a6-012d6 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee95bf81d22571-bd3d6 From: Mao Zhongyi To: qemu-devel@nongnu.org Date: Fri, 23 Nov 2018 23:30:35 +0800 Message-Id: <20181123153040.18933-17-maozhongyi@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181123153040.18933-1-maozhongyi@cmss.chinamobile.com> References: <20181123153040.18933-1-maozhongyi@cmss.chinamobile.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 221.176.66.79 Subject: [Qemu-devel] [PATCH v2 16/21] timer/etraxfs_timer: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com, Zhang Shengju , Mao Zhongyi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use DeviceClass rather than SysBusDeviceClass in etraxfs_timer_class_init(). Cc: edgar.iglesias@gmail.com Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/timer/etraxfs_timer.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/timer/etraxfs_timer.c b/hw/timer/etraxfs_timer.c index d13bc30b2d..2280914b1d 100644 --- a/hw/timer/etraxfs_timer.c +++ b/hw/timer/etraxfs_timer.c @@ -315,9 +315,10 @@ static void etraxfs_timer_reset(void *opaque) qemu_irq_lower(t->irq); } =20 -static int etraxfs_timer_init(SysBusDevice *dev) +static void etraxfs_timer_realize(DeviceState *dev, Error **errp) { ETRAXTimerState *t =3D ETRAX_TIMER(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 t->bh_t0 =3D qemu_bh_new(timer0_hit, t); t->bh_t1 =3D qemu_bh_new(timer1_hit, t); @@ -326,21 +327,20 @@ static int etraxfs_timer_init(SysBusDevice *dev) t->ptimer_t1 =3D ptimer_init(t->bh_t1, PTIMER_POLICY_DEFAULT); t->ptimer_wd =3D ptimer_init(t->bh_wd, PTIMER_POLICY_DEFAULT); =20 - sysbus_init_irq(dev, &t->irq); - sysbus_init_irq(dev, &t->nmi); + sysbus_init_irq(sbd, &t->irq); + sysbus_init_irq(sbd, &t->nmi); =20 memory_region_init_io(&t->mmio, OBJECT(t), &timer_ops, t, "etraxfs-timer", 0x5c); - sysbus_init_mmio(dev, &t->mmio); + sysbus_init_mmio(sbd, &t->mmio); qemu_register_reset(etraxfs_timer_reset, t); - return 0; } =20 static void etraxfs_timer_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sdc =3D SYS_BUS_DEVICE_CLASS(klass); + DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - sdc->init =3D etraxfs_timer_init; + dc->realize =3D etraxfs_timer_realize; } =20 static const TypeInfo etraxfs_timer_info =3D { --=20 2.17.1