From patchwork Mon Jun 20 16:39:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 9188217 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 51898601C0 for ; Mon, 20 Jun 2016 16:48:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F5C825227 for ; Mon, 20 Jun 2016 16:48:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31DCE27B16; Mon, 20 Jun 2016 16:48:23 +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, 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 A8E9A25227 for ; Mon, 20 Jun 2016 16:48:22 +0000 (UTC) Received: from localhost ([::1]:44971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF2N2-0007Vm-Iv for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Jun 2016 12:48:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF2FJ-0008Ee-Dr for qemu-devel@nongnu.org; Mon, 20 Jun 2016 12:40:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bF2FH-0007Cw-CV for qemu-devel@nongnu.org; Mon, 20 Jun 2016 12:40:20 -0400 Received: from ssl.serverraum.org ([213.133.101.245]:55206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF2FH-0007Cp-6k for qemu-devel@nongnu.org; Mon, 20 Jun 2016 12:40:19 -0400 Received: from thanatos.fritz.box (unknown [IPv6:2001:6f8:968:0:56be:f7ff:fe37:9af7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id E9747223CF; Mon, 20 Jun 2016 18:40:16 +0200 (CEST) Authentication-Results: ssl.serverraum.org; dmarc=none header.from=walle.cc DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1466440817; bh=KCF0MmPjUBpFZJKo0SJGZNWcSLZkVTT0QvONLI73otQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hV3TnWLdsUe40a/DNdRMn/gYQvhEeF13vZYqcz0x8sst2sTmp2C3/SkKNdCYXtpPR +cytBSeJuw+Z4qwJ+fcRT/0eqYThCxelTggcNVaILX9Xi9RBShRHI6ZTWbgfJMM+Gs rCPaqqZWhc0rvm8PR9v3JH8551zO1d0G/OxXQiNw= From: Michael Walle To: qemu-devel@nongnu.org Date: Mon, 20 Jun 2016 18:39:08 +0200 Message-Id: <1466440749-17195-6-git-send-email-michael@walle.cc> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1466440749-17195-1-git-send-email-michael@walle.cc> References: <1466440749-17195-1-git-send-email-michael@walle.cc> X-Virus-Scanned: clamav-milter 0.99.2 at web X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 213.133.101.245 Subject: [Qemu-devel] [PULL 5/6] hw/intc: QOM'ify lm32_pic.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: xiaoqiang zhao , Peter Maydell , Michael Walle Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: xiaoqiang zhao Drop the old SysBus init function and use instance_init Signed-off-by: xiaoqiang zhao Acked-by: Michael Walle Tested-by: Michael Walle Signed-off-by: Michael Walle --- hw/intc/lm32_pic.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/intc/lm32_pic.c b/hw/intc/lm32_pic.c index edc08f1..3dad01c 100644 --- a/hw/intc/lm32_pic.c +++ b/hw/intc/lm32_pic.c @@ -152,17 +152,16 @@ static void pic_reset(DeviceState *d) } } -static int lm32_pic_init(SysBusDevice *sbd) +static void lm32_pic_init(Object *obj) { - DeviceState *dev = DEVICE(sbd); - LM32PicState *s = LM32_PIC(dev); + DeviceState *dev = DEVICE(obj); + LM32PicState *s = LM32_PIC(obj); + SysBusDevice *sbd = SYS_BUS_DEVICE(obj); qdev_init_gpio_in(dev, irq_handler, 32); sysbus_init_irq(sbd, &s->parent_irq); pic = s; - - return 0; } static const VMStateDescription vmstate_lm32_pic = { @@ -181,9 +180,7 @@ static const VMStateDescription vmstate_lm32_pic = { static void lm32_pic_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = lm32_pic_init; dc->reset = pic_reset; dc->vmsd = &vmstate_lm32_pic; } @@ -192,6 +189,7 @@ static const TypeInfo lm32_pic_info = { .name = TYPE_LM32_PIC, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(LM32PicState), + .instance_init = lm32_pic_init, .class_init = lm32_pic_class_init, };