From patchwork Wed Jan 27 02:56:14 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: 8128891 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 2BF299F9E8 for ; Wed, 27 Jan 2016 03:01:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 83DF220295 for ; Wed, 27 Jan 2016 03:01:53 +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 DACEA20279 for ; Wed, 27 Jan 2016 03:01:52 +0000 (UTC) Received: from localhost ([::1]:47940 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOGMi-0001Ve-AM for patchwork-qemu-devel@patchwork.kernel.org; Tue, 26 Jan 2016 22:01:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOGIV-0008VI-9p 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-00068Y-1d for qemu-devel@nongnu.org; Tue, 26 Jan 2016 21:57:31 -0500 Received: from m12-11.163.com ([220.181.12.11]:45909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOGIR-00068L-GH for qemu-devel@nongnu.org; Tue, 26 Jan 2016 21:57:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=eVhK3i8IhGeYsi+4C9 SRfy5liyGU9HDo8eVMUimwQqk=; b=o0c9bYtey+iR6bECBwaCKlX6bcXtdPnDfu mqgS6gmWWbB6p8LD7Pl9IpC+tvdvb8N9J3VkmjOSNLb5R2eOHSU0eDkgma3TLpUP I5NYEw4O2DTE4Yu/XOv5jTZb7X/NqCO2IZTrtTMugJhBNmMdFHRYzJk5goE8oLM9 +gfuiRZ6c= Received: from localhost.localdomain (unknown [101.254.142.162]) by smtp7 (Coremail) with SMTP id C8CowACnv+v2MahWlXGeAA--.47488S5; Wed, 27 Jan 2016 10:57:01 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Wed, 27 Jan 2016 10:56:14 +0800 Message-Id: <1453863375-7618-4-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--.47488S5 X-Coremail-Antispam: 1Uf129KBjvJXoW7WF18KF45GFyfZFW3Xw4DXFb_yoW8Ary5pF WxWFnrArnIyrs8tw4xJFnrGFW8XFn7uF45Can7tws7AFn7Wa4DJ3WUAa97tF4xXFWkuFy3 A3yrWF13Zr45Jw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UHWl9UUUUU= X-Originating-IP: [101.254.142.162] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/xtbB0h-8xlUL9O+6xAAAsM 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 13/14] hw/timer: QOM'ify slavio_timer 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 rename slavio_timer_init1 to slavio_timer_init and assign it to slavio_timer_info.instance_init, then we drop the SysBusDeviceClass::init Signed-off-by: xiaoqiang zhao --- hw/timer/slavio_timer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/timer/slavio_timer.c b/hw/timer/slavio_timer.c index 45d97e6..3040d4e 100644 --- a/hw/timer/slavio_timer.c +++ b/hw/timer/slavio_timer.c @@ -372,9 +372,10 @@ static void slavio_timer_reset(DeviceState *d) s->cputimer_mode = 0; } -static int slavio_timer_init1(SysBusDevice *dev) +static void slavio_timer_init(Object *obj) { - SLAVIO_TIMERState *s = SLAVIO_TIMER(dev); + SLAVIO_TIMERState *s = SLAVIO_TIMER(obj); + SysBusDevice *dev = SYS_BUS_DEVICE(obj); QEMUBH *bh; unsigned int i; TimerContext *tc; @@ -399,8 +400,6 @@ static int slavio_timer_init1(SysBusDevice *dev) sysbus_init_irq(dev, &s->cputimer[i].irq); } - - return 0; } static Property slavio_timer_properties[] = { @@ -411,9 +410,7 @@ static Property slavio_timer_properties[] = { static void slavio_timer_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = slavio_timer_init1; dc->reset = slavio_timer_reset; dc->vmsd = &vmstate_slavio_timer; dc->props = slavio_timer_properties; @@ -423,6 +420,7 @@ static const TypeInfo slavio_timer_info = { .name = TYPE_SLAVIO_TIMER, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(SLAVIO_TIMERState), + .instance_init = slavio_timer_init, .class_init = slavio_timer_class_init, };