From patchwork Wed Mar 30 10:09: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: 8695161 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 546A39F39A for ; Wed, 30 Mar 2016 10:13:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AEC7220279 for ; Wed, 30 Mar 2016 10:13:36 +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 157D02014A for ; Wed, 30 Mar 2016 10:13:36 +0000 (UTC) Received: from localhost ([::1]:52932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alD83-0000kb-9P for patchwork-qemu-devel@patchwork.kernel.org; Wed, 30 Mar 2016 06:13:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alD6u-0007OG-3U for qemu-devel@nongnu.org; Wed, 30 Mar 2016 06:12:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alD6r-00068r-Nr for qemu-devel@nongnu.org; Wed, 30 Mar 2016 06:12:24 -0400 Received: from m12-12.163.com ([220.181.12.12]:41090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alD6q-00065N-7D for qemu-devel@nongnu.org; Wed, 30 Mar 2016 06:12:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=3Bd7KiFGyJDTRl6v/Z jkdbWzxq0XQCuzAMnrdap8/V8=; b=md2p5s1ocwDFd55V/qZ/o2UUaIKx+s9iMX Doxx7yEQbhBmxJjbcpgUGFGYAfgjHWaxcq1w+pptKCST1d2ictE4lEQWQqX9z9Ww FQGoAr6E/AvAAMMn42S23wPfPdduyxVJd/laImJxKQYEsW3jo3vMHLzK8opLYsiz jNcnsUCqQ= Received: from localhost.localdomain (unknown [118.187.28.42]) by smtp8 (Coremail) with SMTP id DMCowAAnIV84pvtWicgFBw--.798S2; Wed, 30 Mar 2016 18:11:34 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Wed, 30 Mar 2016 18:09:43 +0800 Message-Id: <1459332586-13693-1-git-send-email-zxq_yx_007@163.com> X-Mailer: git-send-email 2.1.4 X-CM-TRANSID: DMCowAAnIV84pvtWicgFBw--.798S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7tw4rGF1xJw13Jw4rCF15Arb_yoW8WF43pF Z3uF1j9F4kXFs7Xr4fJw1kWF1kGw1kG3y8JrW7A3sak34DKw1Fqa4DAaySyrZxKrWkZFn8 Zry8trW8JF4UJw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jaQ6LUUUUU= X-Originating-IP: [118.187.28.42] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/1tbiEBc8xlWBUg-lOQAAso X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.12 Cc: peter.maydell@linaro.org, i.mitsyanko@gmail.com, chouteau@adacore.com, michael@walle.cc, peter.chubb@nicta.com.au, edgar.iglesias@gmail.com Subject: [Qemu-devel] [PATCH 6/9] hw/intc: QOM'ify pl190.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 old SysBus init function and use instance_init Signed-off-by: xiaoqiang zhao --- hw/intc/pl190.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/intc/pl190.c b/hw/intc/pl190.c index 5ecbc4a..1e50baf 100644 --- a/hw/intc/pl190.c +++ b/hw/intc/pl190.c @@ -236,17 +236,17 @@ static void pl190_reset(DeviceState *d) pl190_update_vectors(s); } -static int pl190_init(SysBusDevice *sbd) +static void pl190_init(Object *obj) { - DeviceState *dev = DEVICE(sbd); - PL190State *s = PL190(dev); + DeviceState *dev = DEVICE(obj); + PL190State *s = PL190(obj); + SysBusDevice *sbd = SYS_BUS_DEVICE(obj); - memory_region_init_io(&s->iomem, OBJECT(s), &pl190_ops, s, "pl190", 0x1000); + memory_region_init_io(&s->iomem, obj, &pl190_ops, s, "pl190", 0x1000); sysbus_init_mmio(sbd, &s->iomem); qdev_init_gpio_in(dev, pl190_set_irq, 32); sysbus_init_irq(sbd, &s->irq); sysbus_init_irq(sbd, &s->fiq); - return 0; } static const VMStateDescription vmstate_pl190 = { @@ -271,9 +271,7 @@ static const VMStateDescription vmstate_pl190 = { static void pl190_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = pl190_init; dc->reset = pl190_reset; dc->vmsd = &vmstate_pl190; } @@ -282,6 +280,7 @@ static const TypeInfo pl190_info = { .name = TYPE_PL190, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(PL190State), + .instance_init = pl190_init, .class_init = pl190_class_init, };