From patchwork Sun Oct 23 09:18:16 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: 9391051 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 50DA8607D0 for ; Sun, 23 Oct 2016 09:23:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4216228D1B for ; Sun, 23 Oct 2016 09:23:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3695028D56; Sun, 23 Oct 2016 09:23:07 +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 D868F28D1B for ; Sun, 23 Oct 2016 09:23:06 +0000 (UTC) Received: from localhost ([::1]:40281 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byEzi-0002jB-5x for patchwork-qemu-devel@patchwork.kernel.org; Sun, 23 Oct 2016 05:23:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byEvi-0008GC-CJ for qemu-devel@nongnu.org; Sun, 23 Oct 2016 05:18:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byEvd-0002b9-CQ for qemu-devel@nongnu.org; Sun, 23 Oct 2016 05:18:58 -0400 Received: from m12-11.163.com ([220.181.12.11]:39476) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byEvc-0002ad-IH; Sun, 23 Oct 2016 05:18:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=FoxPM+xdroYTOOInnV bXp9AUjigBI2ArmGxSrifnbn0=; b=Qse83ggWzQJqi0nJPwxM3uQH12tn3ljIOp 6VQmL3t7DlcdvGMTyAMkob0iMbqPqgsAhkXd1onm/1k8H3G+mj7WIFeuhHgV1m+u vntp0TzMPPA9l2Zz3MPZHlqiSKfkY6a9tSIydz1YwbqTUMzmRYoezvTYZ2bKahdd +FJtbY0oE= Received: from debian.lan (unknown [114.111.167.207]) by smtp7 (Coremail) with SMTP id C8CowACHR3FSgAxYG4EdBQ--.32654S6; Sun, 23 Oct 2016 17:18:21 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Sun, 23 Oct 2016 17:18:16 +0800 Message-Id: <20161023091816.3839-5-zxq_yx_007@163.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161023091816.3839-1-zxq_yx_007@163.com> References: <20161023091816.3839-1-zxq_yx_007@163.com> X-CM-TRANSID: C8CowACHR3FSgAxYG4EdBQ--.32654S6 X-Coremail-Antispam: 1Uf129KBjvJXoW7tw1rJr1xuw4fXF4kZFyUtrb_yoW8Xr1DpF WfuF1jy3yrXF4DJw4xtF1kWr1DCan7G34rtrZ2yw1fZ34jkrsxta4kC3yayr4jgay8Z3WF 9FWrtF47tr48Aw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07beKZJUUUUU= X-Originating-IP: [114.111.167.207] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/xtbB0h0MxlUMBQbehQAAsE X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.11 Subject: [Qemu-devel] [PATCH 4/4] hw/display: QOM'ify pl110.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-arm@nongnu.org, jan.kiszka@web.de 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 and use instance_init and DeviceClass::realize instead Signed-off-by: xiaoqiang zhao --- hw/display/pl110.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/display/pl110.c b/hw/display/pl110.c index c069c0b..eae4cde 100644 --- a/hw/display/pl110.c +++ b/hw/display/pl110.c @@ -466,17 +466,15 @@ static const GraphicHwOps pl110_gfx_ops = { .gfx_update = pl110_update_display, }; -static int pl110_initfn(SysBusDevice *sbd) +static void pl110_realize(DeviceState *dev, Error **errp) { - DeviceState *dev = DEVICE(sbd); PL110State *s = PL110(dev); - + SysBusDevice *sbd = SYS_BUS_DEVICE(dev); memory_region_init_io(&s->iomem, OBJECT(s), &pl110_ops, s, "pl110", 0x1000); sysbus_init_mmio(sbd, &s->iomem); sysbus_init_irq(sbd, &s->irq); qdev_init_gpio_in(dev, pl110_mux_ctrl_set, 1); s->con = graphic_console_init(dev, 0, &pl110_gfx_ops, s); - return 0; } static void pl110_init(Object *obj) @@ -503,11 +501,10 @@ static void pl111_init(Object *obj) static void pl110_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = pl110_initfn; set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); dc->vmsd = &vmstate_pl110; + dc->realize = pl110_realize; } static const TypeInfo pl110_info = {