From patchwork Mon Mar 7 07:05:42 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: 8515731 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 93A6EC0553 for ; Mon, 7 Mar 2016 07:08:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F091020148 for ; Mon, 7 Mar 2016 07:08:08 +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 56D7720142 for ; Mon, 7 Mar 2016 07:08:08 +0000 (UTC) Received: from localhost ([::1]:53995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acpGx-0003D2-Jc for patchwork-qemu-devel@patchwork.kernel.org; Mon, 07 Mar 2016 02:08:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acpGc-00033a-SW 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 1acpGZ-0004FQ-Rt for qemu-devel@nongnu.org; Mon, 07 Mar 2016 02:07:46 -0500 Received: from m12-15.163.com ([220.181.12.15]:47934) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acpGZ-0004Ad-8B; Mon, 07 Mar 2016 02:07:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=PhtssmaZUY9KwPONOv c3qeVx7jUsb1yToAdMky0PnlA=; b=V7YX+8H8A+QJB6IXFaQax/Q1lylG6jjWfY xWfignDmmywrsItkrZ/0LnunLxWYC649/ZRmb+euiSw5Ck+RDX/bk5k/xxR+dNN/ 0InsmTqhWGpGf2lx3ECgBM9gp8q7B2cc/mSwXCKvotNPxxgc94QAzgcQFw47pqYM BXK/2tvFY= Received: from localhost.localdomain (unknown [101.254.142.162]) by smtp11 (Coremail) with SMTP id D8CowED5XEaRKN1WjMdtAA--.46751S3; Mon, 07 Mar 2016 15:07:06 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Mon, 7 Mar 2016 15:05:42 +0800 Message-Id: <1457334350-5675-2-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--.46751S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF4xGF4DGryUAr1fGF45ZFb_yoW8Gw1rpF 97uFs7CrW0kF4DG347tr4q93Z8Jwnag34fKr1xJ39akrnrKrWkKw1UJ3ya9a4UKrZ7ZF13 JwsYgwn7ta18Gw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jcEf5UUUUU= X-Originating-IP: [101.254.142.162] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/1tbiMxolxlXle8S7pgAAsY 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 1/9] hw/arm: QOM'ify armv7m.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 Maydell --- hw/arm/armv7m.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index ed7d97f..139247e 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -129,14 +129,14 @@ typedef struct { uint32_t base; } BitBandState; -static int bitband_init(SysBusDevice *dev) +static void bitband_init(Object *obj) { - BitBandState *s = BITBAND(dev); + BitBandState *s = BITBAND(obj); + SysBusDevice *dev = SYS_BUS_DEVICE(obj); - memory_region_init_io(&s->iomem, OBJECT(s), &bitband_ops, &s->base, + memory_region_init_io(&s->iomem, obj, &bitband_ops, &s->base, "bitband", 0x02000000); sysbus_init_mmio(dev, &s->iomem); - return 0; } static void armv7m_bitband_init(void) @@ -241,9 +241,7 @@ static Property bitband_properties[] = { static void bitband_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = bitband_init; dc->props = bitband_properties; } @@ -251,6 +249,7 @@ static const TypeInfo bitband_info = { .name = TYPE_BITBAND, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(BitBandState), + .instance_init = bitband_init, .class_init = bitband_class_init, };