From patchwork Fri Jan 6 00:26:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhao xiao qiang X-Patchwork-Id: 9499787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8F1A360236 for ; Fri, 6 Jan 2017 00:28:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EBCB2847D for ; Fri, 6 Jan 2017 00:28:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 725EB2848A; Fri, 6 Jan 2017 00:28:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 182AE2847D for ; Fri, 6 Jan 2017 00:28:21 +0000 (UTC) Received: from localhost ([::1]:49397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPIOK-0007Vh-3d for patchwork-qemu-devel@patchwork.kernel.org; Thu, 05 Jan 2017 19:28:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPINU-0007D1-Hc for qemu-devel@nongnu.org; Thu, 05 Jan 2017 19:27:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cPINR-0000sG-F3 for qemu-devel@nongnu.org; Thu, 05 Jan 2017 19:27:28 -0500 Received: from m12-14.163.com ([220.181.12.14]:47933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPINQ-0000qE-Q7; Thu, 05 Jan 2017 19:27:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=duT/ONF6/QlJGvCUUu c8VQLCECrze/0ad/2ngIf5NLg=; b=cwwp+/izSThqj/TWz6C0rmU0hYHGzwKOb1 F/hvPNR3TxH6FTjcVw5kylJSCbtWek94kGcnQbFZOYVWfWg+I2L8069OfJuYA1rt Ky3CddwvSXK0ol7s7ZHvnRRHyPhLGmSA+2imRyBI+lGb5TKLqm9+Wwd0NlT1OrMd yiULBrsIM= Received: from localhost.localdomain (unknown [223.104.3.255]) by smtp10 (Coremail) with SMTP id DsCowABHJps65G5Ymg8zGQ--.36662S4; Fri, 06 Jan 2017 08:26:44 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Fri, 6 Jan 2017 08:26:26 +0800 Message-Id: <20170106002628.10343-3-zxq_yx_007@163.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170106002628.10343-1-zxq_yx_007@163.com> References: <20170106002628.10343-1-zxq_yx_007@163.com> X-CM-TRANSID: DsCowABHJps65G5Ymg8zGQ--.36662S4 X-Coremail-Antispam: 1Uf129KBjvJXoW7tw45trW7uF18AF18Cr4UArb_yoW8JFy7pF ya9FnrCr4DXanIvrWDJFs7GF45Aws7C3W3Gry7Xw1Iya4Uur48AF4DJayFya4DJ3ykuF43 A3WrKFyxJrs8t3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jt2-nUUUUU= X-Originating-IP: [223.104.3.255] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/1tbiTAVXxlSISk-e8QAAsu X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 220.181.12.14 Subject: [Qemu-devel] [PATCH v2 2/4] hw/ppc: QOM'ify e500.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-ppc@nongnu.org, agraf@suse.de, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Drop the old SysBus init function and use instance_init Signed-off-by: xiaoqiang zhao --- hw/ppc/e500.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index cf8b122afe..792bd79d39 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -1049,27 +1049,18 @@ void ppce500_init(MachineState *machine, PPCE500Params *params) boot_info->dt_size = dt_size; } -static int e500_ccsr_initfn(SysBusDevice *dev) +static void e500_ccsr_initfn(Object *obj) { - PPCE500CCSRState *ccsr; - - ccsr = CCSR(dev); - memory_region_init(&ccsr->ccsr_space, OBJECT(ccsr), "e500-ccsr", + PPCE500CCSRState *ccsr = CCSR(obj); + memory_region_init(&ccsr->ccsr_space, obj, "e500-ccsr", MPC8544_CCSRBAR_SIZE); - return 0; -} - -static void e500_ccsr_class_init(ObjectClass *klass, void *data) -{ - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = e500_ccsr_initfn; } static const TypeInfo e500_ccsr_info = { .name = TYPE_CCSR, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(PPCE500CCSRState), - .class_init = e500_ccsr_class_init, + .instance_init = e500_ccsr_initfn, }; static void e500_register_types(void)