From patchwork Mon Jul 1 10:18:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hu Tao X-Patchwork-Id: 256062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1351A2C0313 for ; Mon, 1 Jul 2013 20:22:11 +1000 (EST) Received: from localhost ([::1]:36977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtbFJ-0003KN-3C for incoming@patchwork.ozlabs.org; Mon, 01 Jul 2013 06:22:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtbCy-0008RA-Pz for qemu-devel@nongnu.org; Mon, 01 Jul 2013 06:19:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtbCw-0001Gs-M8 for qemu-devel@nongnu.org; Mon, 01 Jul 2013 06:19:44 -0400 Received: from [222.73.24.84] (port=30230 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtbCw-0001G9-AM for qemu-devel@nongnu.org; Mon, 01 Jul 2013 06:19:42 -0400 X-IronPort-AV: E=Sophos;i="4.87,973,1363104000"; d="scan'208";a="7747754" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 01 Jul 2013 18:16:42 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r61AJccn015553 for ; Mon, 1 Jul 2013 18:19:38 +0800 Received: from G08FNSTD100614.fnst.cn.fujitsu.com ([10.167.233.156]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013070118181368-2618433 ; Mon, 1 Jul 2013 18:18:13 +0800 From: Hu Tao To: qemu-devel Date: Mon, 1 Jul 2013 18:18:19 +0800 Message-Id: <5eb14dae7f16c5ff92b414605acb134bbc5269bc.1372673778.git.hutao@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/07/01 18:18:13, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/07/01 18:18:14, Serialize complete at 2013/07/01 18:18:14 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 222.73.24.84 Subject: [Qemu-devel] [PATCH v2 03/26] ohci: use realize for ohci 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Hu Tao --- hw/usb/hcd-ohci.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 912255d..ee824ee 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -1880,17 +1880,16 @@ typedef struct { dma_addr_t dma_offset; } OHCISysBusState; -static int ohci_init_pxa(SysBusDevice *dev) +static void ohci_realize_pxa(DeviceState *dev, Error **errp) { OHCISysBusState *s = SYSBUS_OHCI(dev); + SysBusDevice *b = SYS_BUS_DEVICE(dev); /* Cannot fail as we pass NULL for masterbus */ - usb_ohci_init(&s->ohci, DEVICE(dev), s->num_ports, s->dma_offset, NULL, 0, + usb_ohci_init(&s->ohci, dev, s->num_ports, s->dma_offset, NULL, 0, &address_space_memory); - sysbus_init_irq(dev, &s->ohci.irq); - sysbus_init_mmio(dev, &s->ohci.mem); - - return 0; + sysbus_init_irq(b, &s->ohci.irq); + sysbus_init_mmio(b, &s->ohci.mem); } static Property ohci_pci_properties[] = { @@ -1930,9 +1929,8 @@ static Property ohci_sysbus_properties[] = { static void ohci_sysbus_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass); - sbc->init = ohci_init_pxa; + dc->realize = ohci_realize_pxa; dc->desc = "OHCI USB Controller"; dc->props = ohci_sysbus_properties; }