From nobody Wed Feb 11 02:14:43 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 1542629635803664.137974127511; Mon, 19 Nov 2018 04:13:55 -0800 (PST) Received: from localhost ([::1]:55562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOiR3-0005yp-MF for importer@patchew.org; Mon, 19 Nov 2018 07:13:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOiMP-0001mb-42 for qemu-devel@nongnu.org; Mon, 19 Nov 2018 07:09:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOiML-0002uG-PP for qemu-devel@nongnu.org; Mon, 19 Nov 2018 07:09:00 -0500 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:51681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOiMK-0002p1-V0 for qemu-devel@nongnu.org; Mon, 19 Nov 2018 07:08:57 -0500 Received: from spf.mail.chinamobile.com (unknown[172.16.121.7]) by rmmx-syy-dmz-app03-12003 (RichMail) with SMTP id 2ee35bf2a7c8bef-914b0; Mon, 19 Nov 2018 20:08:41 +0800 (CST) Received: from localhost.localdomain (unknown[112.25.154.149]) by rmsmtp-syy-appsvr04-12004 (RichMail) with SMTP id 2ee45bf2a7bf447-10511; Mon, 19 Nov 2018 20:08:40 +0800 (CST) X-RM-TRANSID: 2ee35bf2a7c8bef-914b0 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee45bf2a7bf447-10511 From: Mao Zhongyi To: qemu-devel@nongnu.org Date: Mon, 19 Nov 2018 20:08:02 +0800 Message-Id: <20181119120820.29878-5-maozhongyi@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181119120820.29878-1-maozhongyi@cmss.chinamobile.com> References: <20181119120820.29878-1-maozhongyi@cmss.chinamobile.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 221.176.66.79 Subject: [Qemu-devel] [PATCH 04/22] core/empty_slot: 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: 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 empty_slot_class_init(). Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/empty_slot.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/core/empty_slot.c b/hw/core/empty_slot.c index c1b9c2b104..239f78e2a7 100644 --- a/hw/core/empty_slot.c +++ b/hw/core/empty_slot.c @@ -71,21 +71,20 @@ void empty_slot_init(hwaddr addr, uint64_t slot_size) } } =20 -static int empty_slot_init1(SysBusDevice *dev) +static void empty_slot_realize(DeviceState *dev, Error **errp) { EmptySlot *s =3D EMPTY_SLOT(dev); =20 memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s, "empty-slot", s->size); - sysbus_init_mmio(dev, &s->iomem); - return 0; + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); } =20 static void empty_slot_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); + DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - k->init =3D empty_slot_init1; + dc->realize =3D empty_slot_realize; } =20 static const TypeInfo empty_slot_info =3D { --=20 2.17.1