From patchwork Wed Jan 27 02:56:12 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: 8128931 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D05A9BEEE5 for ; Wed, 27 Jan 2016 03:03:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 418E620295 for ; Wed, 27 Jan 2016 03:03:05 +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 A1DA72028D for ; Wed, 27 Jan 2016 03:03:04 +0000 (UTC) Received: from localhost ([::1]:47950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOGNs-000449-3e for patchwork-qemu-devel@patchwork.kernel.org; Tue, 26 Jan 2016 22:03:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOGIV-0008V9-7t for qemu-devel@nongnu.org; Tue, 26 Jan 2016 21:57:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOGIS-00068n-OB for qemu-devel@nongnu.org; Tue, 26 Jan 2016 21:57:31 -0500 Received: from m12-11.163.com ([220.181.12.11]:45985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOGIS-00068Q-9g for qemu-devel@nongnu.org; Tue, 26 Jan 2016 21:57:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=viNVV07XCtzrrrV4MO us4PpOlhn0mNO3wtzddPbqKAc=; b=FnCS+8xxolIkdKYKQ5co5ezO/a9Mo7aWuG /NLGqBLTkIdEPv5fGnLklGuEACiFVFVz8IxUON93BAefQIa4Sk5SM8fGjxE6mICT Az6pFJmygrB3vt8IkzfUqb7nDaOXJ22R1Wj+c/UfpDlZ4I7CgwoOiz411eAignkO vX932BzlQ= Received: from localhost.localdomain (unknown [101.254.142.162]) by smtp7 (Coremail) with SMTP id C8CowACnv+v2MahWlXGeAA--.47488S3; Wed, 27 Jan 2016 10:56:59 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Wed, 27 Jan 2016 10:56:12 +0800 Message-Id: <1453863375-7618-2-git-send-email-zxq_yx_007@163.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1453863375-7618-1-git-send-email-zxq_yx_007@163.com> References: <1453863375-7618-1-git-send-email-zxq_yx_007@163.com> X-CM-TRANSID: C8CowACnv+v2MahWlXGeAA--.47488S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7Cw1xKryDuF47Jw18CFykXwb_yoW8Gr4kpF 9xZF4j9F4vyrs3J3y7Ja1DWF1UJan7Ca4rWrykWwnYyw12kr98JFsrCayfuryrJFWruF15 A3s5trW8JFyUAw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07U8uciUUUUU= X-Originating-IP: [101.254.142.162] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/1tbiEB78xlWBTb+6PwAAsX X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.11 Cc: xiaoqiang zhao , peter.maydell@linaro.org, afaerber@suse.de Subject: [Qemu-devel] [PATCH v2 11/14] 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 Signed-off-by: xiaoqiang zhao --- hw/timer/puv3_ost.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/timer/puv3_ost.c b/hw/timer/puv3_ost.c index fa9eefd..0926c06 100644 --- a/hw/timer/puv3_ost.c +++ b/hw/timer/puv3_ost.c @@ -112,9 +112,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; @@ -130,21 +131,18 @@ 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; } static void puv3_ost_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass); - - sdc->init = puv3_ost_init; + /* do nothing */ } static const TypeInfo puv3_ost_info = { .name = TYPE_PUV3_OST, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(PUV3OSTState), + .instance_init = puv3_ost_init, .class_init = puv3_ost_class_init, };