From patchwork Thu Mar 17 09:06:13 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: 8608441 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 591B6C0553 for ; Thu, 17 Mar 2016 09:08:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B1AC120279 for ; Thu, 17 Mar 2016 09:08:17 +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 16D022026F for ; Thu, 17 Mar 2016 09:08:17 +0000 (UTC) Received: from localhost ([::1]:33543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agTui-0003dL-CT for patchwork-qemu-devel@patchwork.kernel.org; Thu, 17 Mar 2016 05:08:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agTuO-0003YT-Pz for qemu-devel@nongnu.org; Thu, 17 Mar 2016 05:08:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agTuM-0004ap-4d for qemu-devel@nongnu.org; Thu, 17 Mar 2016 05:07:56 -0400 Received: from m12-17.163.com ([220.181.12.17]:49226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agTuL-0004Zj-Ha for qemu-devel@nongnu.org; Thu, 17 Mar 2016 05:07:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=paEQ3h4QlSobD/jNtU 0y/Y228DjRBitpkMsDlNKWC68=; b=jz5JMBOZb4Y4xHQK3EqNDWxfiONqzDdw4p JVGMMoKQp78JdGk1JmM3u4YRsQzfANJZmCTz5pcPycLVAH8czqC1frr7CAikBBGi Gq+PSgveQflQ2sApSnlVA+LDyZaTfRmgTkg4+FomgFb71s8DhdWi1qYVMVlx8g5I WP3tY+SzA= Received: from localhost.localdomain (unknown [118.187.28.42]) by smtp13 (Coremail) with SMTP id EcCowADn0SzUc+pWwyspAw--.30326S3; Thu, 17 Mar 2016 17:07:48 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Thu, 17 Mar 2016 17:06:13 +0800 Message-Id: <1458205576-21646-2-git-send-email-zxq_yx_007@163.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458205576-21646-1-git-send-email-zxq_yx_007@163.com> References: <1458205576-21646-1-git-send-email-zxq_yx_007@163.com> X-CM-TRANSID: EcCowADn0SzUc+pWwyspAw--.30326S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7tw4rAw1kKw1UJryrKw47twb_yoW8XFWDpF 93uFykCr4xtFsrZrZ7JFn5ua4kJwn3C3yxKryxXwnayan7KryDAFnayay2vrWUtrZ2yF15 Xw48JF47Ca1UJ3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jC1v3UUUUU= X-Originating-IP: [118.187.28.42] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/1tbiEAQvxlWBUPVq+QAAsf X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.17 Cc: pbonzini@redhat.com, michael@walle.cc, kraxel@redhat.com, afaerber@suse.de Subject: [Qemu-devel] [RESEND PATCH v2 1/4] hw/audio: QOM'ify cs4231.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 Reviewed-by: Paolo Bonzini Signed-off-by: xiaoqiang zhao --- hw/audio/cs4231.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/audio/cs4231.c b/hw/audio/cs4231.c index caf97c1..30690f9 100644 --- a/hw/audio/cs4231.c +++ b/hw/audio/cs4231.c @@ -145,16 +145,15 @@ static const VMStateDescription vmstate_cs4231 = { } }; -static int cs4231_init1(SysBusDevice *dev) +static void cs4231_init(Object *obj) { - CSState *s = CS4231(dev); + CSState *s = CS4231(obj); + SysBusDevice *dev = SYS_BUS_DEVICE(obj); - memory_region_init_io(&s->iomem, OBJECT(s), &cs_mem_ops, s, "cs4321", + memory_region_init_io(&s->iomem, obj, &cs_mem_ops, s, "cs4321", CS_SIZE); sysbus_init_mmio(dev, &s->iomem); sysbus_init_irq(dev, &s->irq); - - return 0; } static Property cs4231_properties[] = { @@ -164,9 +163,7 @@ static Property cs4231_properties[] = { static void cs4231_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = cs4231_init1; dc->reset = cs_reset; dc->vmsd = &vmstate_cs4231; dc->props = cs4231_properties; @@ -176,6 +173,7 @@ static const TypeInfo cs4231_info = { .name = TYPE_CS4231, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(CSState), + .instance_init = cs4231_init, .class_init = cs4231_class_init, };