From patchwork Wed Jan 27 02:56:11 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: 8128881 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 4449FBEEE5 for ; Wed, 27 Jan 2016 03:01:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99F882028D for ; Wed, 27 Jan 2016 03:01:47 +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 00BAD20279 for ; Wed, 27 Jan 2016 03:01:47 +0000 (UTC) Received: from localhost ([::1]:47938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOGMc-0001Kn-DS for patchwork-qemu-devel@patchwork.kernel.org; Tue, 26 Jan 2016 22:01:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOGIV-0008VK-8M for qemu-devel@nongnu.org; Tue, 26 Jan 2016 21:57:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOGIT-00069Q-2c for qemu-devel@nongnu.org; Tue, 26 Jan 2016 21:57:31 -0500 Received: from m12-11.163.com ([220.181.12.11]:45887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOGIS-000689-Ha for qemu-devel@nongnu.org; Tue, 26 Jan 2016 21:57:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=FWTzHojyeCipypgNy6 MOPd6l6e5Ct0ychmXso9ftC0g=; b=faZwAoxdW5WnVe3XGyK84S2iMHCtrgLQEW ByUysoJ5XjZ+hhr1I5Odw3A6btrwjnmfHzhUHvB6rlpRWkxfgdnxrsWhXlinI5x0 tGek0aYBOl8qiRkws1NRIhYAaoufJyWSBUSFYY1238MlUtvuprccDAu7dcmgHk6o +G5opvkn4= Received: from localhost.localdomain (unknown [101.254.142.162]) by smtp7 (Coremail) with SMTP id C8CowACnv+v2MahWlXGeAA--.47488S2; Wed, 27 Jan 2016 10:56:59 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Wed, 27 Jan 2016 10:56:11 +0800 Message-Id: <1453863375-7618-1-git-send-email-zxq_yx_007@163.com> X-Mailer: git-send-email 2.1.4 X-CM-TRANSID: C8CowACnv+v2MahWlXGeAA--.47488S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7Cr1rJr4rKr4kuw4DXw17trb_yoW8XFW7pF ZruF1qyF4UJrs5Z3yxKF4DWF1DGws7C34fGrn2y3WSyFy5Kr1rJF1kA3yayFW7trZ5uFW3 Zr18JrWUAa18Aw7anT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zRymhcUUUUU= X-Originating-IP: [101.254.142.162] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/xtbBEg78xlZXv2QyoQABsu 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 10/14] hw/timer: QOM'ify pl031 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 pl031_init to pl031_info.instance_init and drop the SysBusDeviceClass::init Signed-off-by: xiaoqiang zhao --- hw/timer/pl031.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/timer/pl031.c b/hw/timer/pl031.c index 34d9b44..b3a2152 100644 --- a/hw/timer/pl031.c +++ b/hw/timer/pl031.c @@ -191,9 +191,10 @@ static const MemoryRegionOps pl031_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -static int pl031_init(SysBusDevice *dev) +static void pl031_init(Object *obj) { - PL031State *s = PL031(dev); + PL031State *s = PL031(obj); + SysBusDevice *dev = SYS_BUS_DEVICE(obj); struct tm tm; memory_region_init_io(&s->iomem, OBJECT(s), &pl031_ops, s, "pl031", 0x1000); @@ -205,7 +206,6 @@ static int pl031_init(SysBusDevice *dev) qemu_clock_get_ns(rtc_clock) / get_ticks_per_sec(); s->timer = timer_new_ns(rtc_clock, pl031_interrupt, s); - return 0; } static void pl031_pre_save(void *opaque) @@ -248,9 +248,7 @@ static const VMStateDescription vmstate_pl031 = { static void pl031_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = pl031_init; dc->vmsd = &vmstate_pl031; } @@ -258,6 +256,7 @@ static const TypeInfo pl031_info = { .name = TYPE_PL031, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(PL031State), + .instance_init = pl031_init, .class_init = pl031_class_init, };