From patchwork Thu Feb 25 10:30:34 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: 8422151 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 1833A9F372 for ; Thu, 25 Feb 2016 10:35:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89A90202AE for ; Thu, 25 Feb 2016 10:35:24 +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 DF7A520266 for ; Thu, 25 Feb 2016 10:35:23 +0000 (UTC) Received: from localhost ([::1]:41978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYtGV-0002HG-7J for patchwork-qemu-devel@patchwork.kernel.org; Thu, 25 Feb 2016 05:35:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYtEf-0007h1-AS for qemu-devel@nongnu.org; Thu, 25 Feb 2016 05:33:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYtEd-0001rb-Sa for qemu-devel@nongnu.org; Thu, 25 Feb 2016 05:33:29 -0500 Received: from m12-14.163.com ([220.181.12.14]:55843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYtEd-0001oM-3i; Thu, 25 Feb 2016 05:33:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=sL+kkWlGIpX9++bczd xxz0Kn2R31LiCXydte25JJxa4=; b=WTdPhkaS9D5lZZjjviBjCfrq7kGlTmqJ8c +YD4U7fUl9M8pYReHbhS8NKpMnrJZywHCpvIKTB+A7WyGcFpLKaw2hv1Og7FEn9h TBqYCj6lwkoPC2K78XQsoyqklulAAqNN/vDaKk1ScWxo1Lkk1b+n8/N4WnoR7gPk vkhhnxWEg= Received: from localhost.localdomain (unknown [101.254.142.162]) by smtp10 (Coremail) with SMTP id DsCowAB3JtoL2M5WrXOWCA--.37006S8; Thu, 25 Feb 2016 18:31:51 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Thu, 25 Feb 2016 18:30:34 +0800 Message-Id: <1456396236-2759-7-git-send-email-zxq_yx_007@163.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456396236-2759-1-git-send-email-zxq_yx_007@163.com> References: <1456396236-2759-1-git-send-email-zxq_yx_007@163.com> X-CM-TRANSID: DsCowAB3JtoL2M5WrXOWCA--.37006S8 X-Coremail-Antispam: 1Uf129KBjvJXoW7Cw1xKryDuFWrtw1kAFy3twb_yoW8Xw1kpa sxZF429F4DArsxJw47JwsrJF15Jan7Ca48WrykWwnYyw12kr1DJFs7CFWS9rW5JFZ5uF15 A3s5trW8Ja4UXw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jOTmhUUUUU= X-Originating-IP: [101.254.142.162] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/1tbiEBgaxlWBT2U2JgAAs6 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.14 Cc: peter.maydell@linaro.org, i.mitsyanko@gmail.com, 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 v5 6/8] 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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,UNPARSEABLE_RELAY autolearn=no 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 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)