From patchwork Thu Mar 24 10:29:34 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: 8659471 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 46A24C0553 for ; Thu, 24 Mar 2016 10:34:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A5B1E2026D for ; Thu, 24 Mar 2016 10:34:12 +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 097142037F for ; Thu, 24 Mar 2016 10:34:12 +0000 (UTC) Received: from localhost ([::1]:49061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj2ah-00038J-Ax for patchwork-qemu-devel@patchwork.kernel.org; Thu, 24 Mar 2016 06:34:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj2Yh-0007wr-Ni for qemu-devel@nongnu.org; Thu, 24 Mar 2016 06:32:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj2Yc-0005bz-N2 for qemu-devel@nongnu.org; Thu, 24 Mar 2016 06:32:07 -0400 Received: from m12-16.163.com ([220.181.12.16]:34289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj2Yb-0005W3-OC; Thu, 24 Mar 2016 06:32:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=JiZOJgcbgS609cqPcB euCcZeh62y6DgQZP8TG5/tr4Q=; b=enVH6707xCWNZjt8/mRY0tBU4bqMXZ4slH SxdIFNE79AAoxqxdv4Lngm9Zy13UcGWkXfcJ+NR2EPRdP+hO6Q8YtcKkDXhDkPN+ DDr09M33YMTyCK46GS7d/T4Ni7ZXPozieeIG4xfEqWAz8uQ94mMNEnzyDj2hIfuZ VKFIUS2QI= Received: from localhost.localdomain (unknown [101.254.142.162]) by smtp12 (Coremail) with SMTP id EMCowEDpR1DcwfNWAMmNAA--.623S11; Thu, 24 Mar 2016 18:31:03 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Thu, 24 Mar 2016 18:29:34 +0800 Message-Id: <1458815374-22279-10-git-send-email-zxq_yx_007@163.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458815374-22279-1-git-send-email-zxq_yx_007@163.com> References: <1458815374-22279-1-git-send-email-zxq_yx_007@163.com> X-CM-TRANSID: EMCowEDpR1DcwfNWAMmNAA--.623S11 X-Coremail-Antispam: 1Uf129KBjvJXoW7Kr45CF4rKFy5XFWkZF4kCrg_yoW8Gw4rpF Z3uF18Z3yrJFsrJw1ft3WkWFn0kw1kGw4rtrW2ywnYy342kw4rta4DJ3yIyrWUtay0vF1Y 9FWrJFW7tr18Aw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jwyCJUUUUU= X-Originating-IP: [101.254.142.162] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/1tbiMwc2xlXlfSdQuQAAsH X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 220.181.12.16 Cc: i.mitsyanko@gmail.com, peter.maydell@linaro.org, michael@walle.cc, qemu-arm@nongnu.org, hirofumi@mail.parknet.co.jp Subject: [Qemu-devel] [PATCH 6/6] QOM hw/display/pl110.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 --- hw/display/pl110.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/hw/display/pl110.c b/hw/display/pl110.c index d589959..342e7ed 100644 --- a/hw/display/pl110.c +++ b/hw/display/pl110.c @@ -465,23 +465,17 @@ static const GraphicHwOps pl110_gfx_ops = { .gfx_update = pl110_update_display, }; -static int pl110_initfn(SysBusDevice *sbd) +static void pl110_init(Object *obj) { - DeviceState *dev = DEVICE(sbd); - PL110State *s = PL110(dev); + DeviceState *dev = DEVICE(obj); + PL110State *s = PL110(obj); + SysBusDevice *sbd = SYS_BUS_DEVICE(obj); - memory_region_init_io(&s->iomem, OBJECT(s), &pl110_ops, s, "pl110", 0x1000); + memory_region_init_io(&s->iomem, obj, &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) -{ - PL110State *s = PL110(obj); - s->version = PL110; } @@ -502,9 +496,7 @@ 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; }