From patchwork Thu Dec 13 14:54:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 153677 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp920627ljp; Thu, 13 Dec 2018 07:16:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/WPTIg3tIJb6WZqJ8On1BqU/EzzjhkRZgd1xo3VjftMKfKhWvadj+EmmuwgcLfU9a4HKEnk X-Received: by 2002:a0c:ba24:: with SMTP id w36mr23209113qvf.60.1544714187550; Thu, 13 Dec 2018 07:16:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544714187; cv=none; d=google.com; s=arc-20160816; b=SJtO99a14sdh+G35EOaVGN+oMdRyjzoCJy+THvqU02LeqfL13ma/D9FNcuWCbm8FOI E0sthmwoGZpcRGfkXne7Yqc0iEKZ3UvWEukHwji8d5HqvT35ZuFYeu4ZE6TTAVn4/ESH 3SmjJ776KJf141C80SAbM1jFlvHszjiDIg8XbT33YO6RcvtrgkC58aCGkjhk9yXt/KDW q+vlfPvEnZ03oeOtXAmdpgx8b76nB6QtaPOCtFnvQRC12lbOieqLcWQmbOOOmRe2j+Dn FjdyF7Xyp3Jps1yKKyckJ93brF4UB0okyy4X3kNe2zWWR4Ku9kRkL4FMONkCFR6u4MGE wTxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from; bh=0G5WFk4mncHBvlcOWYPQJU/K+jy52lROaITj6hyBKyc=; b=fOcT/RBQw25rFZeMKOdYoK1vKOi4fjJpoZ9XfhVA24LPOlj78c0q3c8NX7OrlTE5H7 9p3In3aX1wVGgpNghQxDBlwq3mHMxLD16F5dDkhULE5ZCG0p4FOh1OeT8/sK2eMgdcLG TYtj4seg28oea2xQ7mXyoh9G2fwo5AUSzHYLCOgLFNG2ksnHEUV+SRFGzwq9tUrxewis S/xv/FzY1r3w6IjC4cUFbzEo3YyYAJ/xf9clJevZYAUARKddhFUapOk3jZxIaN6Za6wb Je/fRbbItjPMXGQ0wrJs7uGVDyx8qea+5znFYiSmGqCU+El7D0fmzt06LHRm3/nYrjuz l3YQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c41si469800qtk.178.2018.12.13.07.16.27 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 13 Dec 2018 07:16:27 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSiw-0007GZ-Tv for patch@linaro.org; Thu, 13 Dec 2018 10:16:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSPJ-0005EW-Bl for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSPI-0000Sq-Ey for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:09 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSPI-0006zA-5y for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:56:08 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO8-0007Jy-Qm for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:56 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:28 +0000 Message-Id: <20181213145445.17935-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 20/37] timer/puv3_ost: 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in puv3_ost_class_init(). Cc: gxt@mprc.pku.edu.cn Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daudé Message-id: 20181130093852.20739-19-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/timer/puv3_ost.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.19.2 diff --git a/hw/timer/puv3_ost.c b/hw/timer/puv3_ost.c index 0b3d717e608..3be58c7fdd7 100644 --- a/hw/timer/puv3_ost.c +++ b/hw/timer/puv3_ost.c @@ -113,16 +113,17 @@ static void puv3_ost_tick(void *opaque) } } -static int puv3_ost_init(SysBusDevice *dev) +static void puv3_ost_realize(DeviceState *dev, Error **errp) { PUV3OSTState *s = PUV3_OST(dev); + SysBusDevice *sbd = SYS_BUS_DEVICE(dev); s->reg_OIER = 0; s->reg_OSSR = 0; s->reg_OSMR0 = 0; s->reg_OSCR = 0; - sysbus_init_irq(dev, &s->irq); + sysbus_init_irq(sbd, &s->irq); s->bh = qemu_bh_new(puv3_ost_tick, s); s->ptimer = ptimer_init(s->bh, PTIMER_POLICY_DEFAULT); @@ -130,16 +131,14 @@ static int puv3_ost_init(SysBusDevice *dev) memory_region_init_io(&s->iomem, OBJECT(s), &puv3_ost_ops, s, "puv3_ost", PUV3_REGS_OFFSET); - sysbus_init_mmio(dev, &s->iomem); - - return 0; + sysbus_init_mmio(sbd, &s->iomem); } static void puv3_ost_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass); + DeviceClass *dc = DEVICE_CLASS(klass); - sdc->init = puv3_ost_init; + dc->realize = puv3_ost_realize; } static const TypeInfo puv3_ost_info = {