From patchwork Thu May 5 10:29:48 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: 9023381 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 B99739F1D3 for ; Thu, 5 May 2016 10:36:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 15A14203C0 for ; Thu, 5 May 2016 10:36:51 +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 68A16203B7 for ; Thu, 5 May 2016 10:36:50 +0000 (UTC) Received: from localhost ([::1]:53043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayGeE-0001Xd-Ja for patchwork-qemu-devel@patchwork.kernel.org; Thu, 05 May 2016 06:36:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayGZb-0000js-3e for qemu-devel@nongnu.org; Thu, 05 May 2016 06:32:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ayGZP-0000au-FX for qemu-devel@nongnu.org; Thu, 05 May 2016 06:31:53 -0400 Received: from m12-14.163.com ([220.181.12.14]:50469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayGZK-0000SC-CD for qemu-devel@nongnu.org; Thu, 05 May 2016 06:31:44 -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=HwziMu3aE1V+Vp6sdtX+x3XjLati64gdyg z6C8ps+iIOz4FVKWBcrystKqkdajyuLSkAqxkBb3ep5EzPAz80fM0wsz69Bp8nLn TlQuE2VPmu7W2jy5DWgTqRqWGgNPS9QKp1MOiXMxexlzk6wnVf2NZjHRUbZKWQ2K Z4HD+7Nlc= Received: from localhost.localdomain (unknown [118.187.28.42]) by smtp10 (Coremail) with SMTP id DsCowAC3UtHBICtXgr4+Ag--.48528S2; Thu, 05 May 2016 18:30:42 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Thu, 5 May 2016 18:29:48 +0800 Message-Id: <1462444191-18595-1-git-send-email-zxq_yx_007@163.com> X-Mailer: git-send-email 2.1.4 X-CM-TRANSID: DsCowAC3UtHBICtXgr4+Ag--.48528S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7tw4rGF1xJw13Jw4rCF15Arb_yoW8WF43pF Z3uF1j9F4kXFs7Xr4fJw1kWF1kGw1kG3y8JrW7A3sak34DKw1Fqa4DAaySyrZxKrWkZFn8 Zry8trW8JF4UJw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jIKZXUUUUU= X-Originating-IP: [118.187.28.42] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/1tbiMxJgxlXlgGd9WAAAs1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.14 Subject: [Qemu-devel] [PATCH v1 6/9] hw/intc: QOM'ify pl190.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, i.mitsyanko@gmail.com, chouteau@adacore.com, blauwirbel@gmail.com, michael@walle.cc, peter.chubb@nicta.com.au, edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SBL, 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, };