From patchwork Tue Feb 16 11:10:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhao xiao qiang X-Patchwork-Id: 8324121 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 93BAC9F72C for ; Tue, 16 Feb 2016 11:16:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E5EF720279 for ; Tue, 16 Feb 2016 11:16:26 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 450B920272 for ; Tue, 16 Feb 2016 11:16:26 +0000 (UTC) Received: from localhost ([::1]:44383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVdcH-0005uD-Io for patchwork-qemu-devel@patchwork.kernel.org; Tue, 16 Feb 2016 06:16:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVdY0-00075i-SA for qemu-devel@nongnu.org; Tue, 16 Feb 2016 06:12:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVdXv-0006qP-1Q for qemu-devel@nongnu.org; Tue, 16 Feb 2016 06:12:00 -0500 Received: from m12-12.163.com ([220.181.12.12]:35703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVdXu-0006om-J1; Tue, 16 Feb 2016 06:11:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=n3h2kpZrqaH3tCd1Ws 3FHOF8flVT79P1oGqo6SoGxfs=; b=W8ZfZvgW7Qc9gmhJzIz3Ys20u5gCF4aZsH o1k7pxAm1zAxw44+kNSf8cA/rr5zWo9DkvvYF9fVcCaC33U1nB5HFYDq+HAf5pJY KYVToLA3v3oB0Qv0BhN//ztzp7Z32HjSR8djxEE1u1HGFtMszK24+QPahPAI60oW Iyy18tteY= Received: from localhost.localdomain (unknown [118.187.28.42]) by smtp8 (Coremail) with SMTP id DMCowABXn_PgA8NWODCxBQ--.25459S5; Tue, 16 Feb 2016 19:11:33 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Tue, 16 Feb 2016 19:10:24 +0800 Message-Id: <1455621027-13927-4-git-send-email-zxq_yx_007@163.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1455621027-13927-1-git-send-email-zxq_yx_007@163.com> References: <1455621027-13927-1-git-send-email-zxq_yx_007@163.com> X-CM-TRANSID: DMCowABXn_PgA8NWODCxBQ--.25459S5 X-Coremail-Antispam: 1Uf129KBjvJXoW7Cw1fCF1rJFWkXr48JrWrZrb_yoW8WrWkpa sxZF4I9F4DArsxJw47JwsrJF1rJan7Ca48WrykWwnYy342kryDJFs7GFWS9FW5JFZY9F1Y y3s5trW8Ja4UXw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07Ua0PhUUUUU= X-Originating-IP: [118.187.28.42] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/xtbBEgYRxlZXwGucQQAAs0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.12 Cc: peter.maydell@linaro.org, e.voevodin@samsung.com, xiaoqiang zhao , mark.cave-ayland@ilande.co.uk, michael@walle.cc, qemu-arm@nongnu.org, edgar.iglesias@gmail.com, gxt@mprc.pku.edu.cn, afaerber@suse.de Subject: [Qemu-devel] [PATCH v3 13/16] hw/timer: QOM'ify puv3_ost X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP assign puv3_ost_init to puv3_ost_info.instance_init and drop the SysBusDeviceClass::init Reviewed-by: Peter Maydell Signed-off-by: xiaoqiang zhao --- hw/timer/puv3_ost.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/hw/timer/puv3_ost.c b/hw/timer/puv3_ost.c index 93650b7..72c87ba 100644 --- a/hw/timer/puv3_ost.c +++ b/hw/timer/puv3_ost.c @@ -113,9 +113,10 @@ static void puv3_ost_tick(void *opaque) } } -static int puv3_ost_init(SysBusDevice *dev) +static void puv3_ost_init(Object *obj) { - PUV3OSTState *s = PUV3_OST(dev); + PUV3OSTState *s = PUV3_OST(obj); + SysBusDevice *dev = SYS_BUS_DEVICE(obj); s->reg_OIER = 0; s->reg_OSSR = 0; @@ -128,25 +129,16 @@ static int puv3_ost_init(SysBusDevice *dev) s->ptimer = ptimer_init(s->bh); ptimer_set_freq(s->ptimer, 50 * 1000 * 1000); - memory_region_init_io(&s->iomem, OBJECT(s), &puv3_ost_ops, s, "puv3_ost", + memory_region_init_io(&s->iomem, obj, &puv3_ost_ops, s, "puv3_ost", PUV3_REGS_OFFSET); sysbus_init_mmio(dev, &s->iomem); - - return 0; -} - -static void puv3_ost_class_init(ObjectClass *klass, void *data) -{ - SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass); - - sdc->init = puv3_ost_init; } static const TypeInfo puv3_ost_info = { .name = TYPE_PUV3_OST, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(PUV3OSTState), - .class_init = puv3_ost_class_init, + .instance_init = puv3_ost_init, }; static void puv3_ost_register_type(void)