From patchwork Mon Mar 7 07:05:43 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: 8515721 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 34558C0553 for ; Mon, 7 Mar 2016 07:08:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8BE7920149 for ; Mon, 7 Mar 2016 07:08: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 E630720142 for ; Mon, 7 Mar 2016 07:08:04 +0000 (UTC) Received: from localhost ([::1]:53992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acpGu-00036z-3z for patchwork-qemu-devel@patchwork.kernel.org; Mon, 07 Mar 2016 02:08:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acpGc-00033d-T8 for qemu-devel@nongnu.org; Mon, 07 Mar 2016 02:07:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acpGb-0004G1-2i for qemu-devel@nongnu.org; Mon, 07 Mar 2016 02:07:46 -0500 Received: from m12-15.163.com ([220.181.12.15]:47932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acpGa-0004Am-A0; Mon, 07 Mar 2016 02:07:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=3+0N9yKqciLGKTXG2y SQN8QxlWMGyxW5riQayCbEj9E=; b=SHjZaqYRApMm1/m9DI1/7YU1uFIdpTxgTP T4PBEEhHLwKQLagcvtrNdQv1s8ReoPfB3jvnHjShMys7rY3gy4sqhqvdQJ3XAyg0 lpVFfpMyL503cA/p25Rei23ZSUbb0KaB9sS0rMQvl96LZpycgzFdGyWJeWOM32Yu +rbfpBQeU= Received: from localhost.localdomain (unknown [101.254.142.162]) by smtp11 (Coremail) with SMTP id D8CowED5XEaRKN1WjMdtAA--.46751S4; Mon, 07 Mar 2016 15:07:06 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Mon, 7 Mar 2016 15:05:43 +0800 Message-Id: <1457334350-5675-3-git-send-email-zxq_yx_007@163.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1457334350-5675-1-git-send-email-zxq_yx_007@163.com> References: <1457334350-5675-1-git-send-email-zxq_yx_007@163.com> X-CM-TRANSID: D8CowED5XEaRKN1WjMdtAA--.46751S4 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF4xGF4kur1DJr43XryftFb_yoW8Xw4kpw n7uFZ0kr45GF4kAF47XF95uF4UJan2kryxWrZ7Ja1Sy3W7CrWUuw4rGFySkryjqrWkAFy3 tr18t3WkJr4rCw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07j9OzsUUUUU= X-Originating-IP: [101.254.142.162] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/1tbiOxslxlXlSMIJuwAAsL X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 220.181.12.15 Cc: robh@kernel.org, qemu-arm@nongnu.org, peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH 2/9] hw/arm: QOM'ify highbank.c 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 Drop the use of old SysBus init function and use instance_init Signed-off-by: xiaoqiang zhao Reviewed-by: Peter Crosthwaite --- hw/arm/highbank.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index e25cf5e..8f38dff 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -167,23 +167,20 @@ static void highbank_regs_reset(DeviceState *dev) s->regs[0x43] = 0x05F40121; } -static int highbank_regs_init(SysBusDevice *dev) +static void highbank_regs_init(Object *obj) { - HighbankRegsState *s = HIGHBANK_REGISTERS(dev); + HighbankRegsState *s = HIGHBANK_REGISTERS(obj); + SysBusDevice *dev = SYS_BUS_DEVICE(obj); - memory_region_init_io(&s->iomem, OBJECT(s), &hb_mem_ops, s->regs, + memory_region_init_io(&s->iomem, obj, &hb_mem_ops, s->regs, "highbank_regs", 0x1000); sysbus_init_mmio(dev, &s->iomem); - - return 0; } static void highbank_regs_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); - sbc->init = highbank_regs_init; dc->desc = "Calxeda Highbank registers"; dc->vmsd = &vmstate_highbank_regs; dc->reset = highbank_regs_reset; @@ -193,6 +190,7 @@ static const TypeInfo highbank_regs_info = { .name = TYPE_HIGHBANK_REGISTERS, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(HighbankRegsState), + .instance_init = highbank_regs_init, .class_init = highbank_regs_class_init, };