From patchwork Tue Jun 11 06:57:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 250471 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 C441A2C007E for ; Tue, 11 Jun 2013 17:03:00 +1000 (EST) Received: from localhost ([::1]:49566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmIba-0003WA-Uf for incoming@patchwork.ozlabs.org; Tue, 11 Jun 2013 03:02:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmIbH-0003T4-Td for qemu-devel@nongnu.org; Tue, 11 Jun 2013 03:02:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmIbG-0001TG-LU for qemu-devel@nongnu.org; Tue, 11 Jun 2013 03:02:39 -0400 Received: from mail-pb0-x229.google.com ([2607:f8b0:400e:c01::229]:65217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmIbG-0001TA-BI for qemu-devel@nongnu.org; Tue, 11 Jun 2013 03:02:38 -0400 Received: by mail-pb0-f41.google.com with SMTP id rp16so4616372pbb.0 for ; Tue, 11 Jun 2013 00:02:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=GCRRyX+3rbUgB9jbXaJvqZU/pEJaVbzVE623I673wKw=; b=S+K6fUk3f22f8+6c8GlWb/L/zWUkkgA1ncWbrNr5uTOLINELRSGOVyufoqbX3xWNUg SxLTUf2nv5X/vcSAjpLpfa5M7+cf5MfTwRtPn//NPgkCpEDos7q/qbSfdCLRh9/RgPqc 5L8iBulXCh9ILKr6Iq5dL/UWqFi0JrxbLkqz7Kck+27/nHXBll/QZlMjAupwjE4I5S5D uuKlsTjMsRY9jlBjCATNkihdJHMU6kcPBu56g1wvlLio3S+OHRODIfFioolrWVtz8Uqs +mSM8m8XrwknUNd4I/SN2rM7S1gwQeJzkxrChSiB3Lg9BjDKeK/iwUknIcmKTe7UkKYF Ej3A== X-Received: by 10.66.136.76 with SMTP id py12mr17272410pab.192.1370934157547; Tue, 11 Jun 2013 00:02:37 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id tq8sm13456358pbc.30.2013.06.11.00.02.31 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Tue, 11 Jun 2013 00:02:36 -0700 (PDT) From: peter.crosthwaite@xilinx.com To: qemu-devel@nongnu.org Date: Tue, 11 Jun 2013 16:57:27 +1000 Message-Id: <330a0b2ae5816dedde42658a765047a01300581e.1370931825.git.peter.crosthwaite@xilinx.com> X-Mailer: git-send-email 1.8.3.rc1.44.gb387c77.dirty In-Reply-To: References: X-Gm-Message-State: ALoCoQktz+5GETUFI3eaIqlxy4yv0upCZs9NsHeuAzwUARoikWtsg+HGbwmyZ2X0IkUupYDNV0iq X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::229 Cc: pbonzini@redhat.com, aliguori@us.ibm.com, afaerber@suse.de Subject: [Qemu-devel] [RFT PATCH v1 23/30] usb/*: substitute ->qdev casts with DEVICE() 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 From: Peter Crosthwaite Signed-off-by: Peter Crosthwaite --- hw/usb/hcd-ehci-pci.c | 13 ++++++++----- hw/usb/hcd-ohci.c | 2 +- hw/usb/hcd-uhci.c | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c index 0eb7826..c772e1f 100644 --- a/hw/usb/hcd-ehci-pci.c +++ b/hw/usb/hcd-ehci-pci.c @@ -197,6 +197,7 @@ int ehci_create_ich9_with_companions(PCIBus *bus, int slot) const struct ehci_companions *comp; PCIDevice *ehci, *uhci; BusState *usbbus; + DeviceState *dev; const char *name; int i; @@ -214,15 +215,17 @@ int ehci_create_ich9_with_companions(PCIBus *bus, int slot) } ehci = pci_create_multifunction(bus, PCI_DEVFN(slot, 7), true, name); - qdev_init_nofail(&ehci->qdev); - usbbus = QLIST_FIRST(&ehci->qdev.child_bus); + dev = DEVICE(ehci); + qdev_init_nofail(dev); + usbbus = QLIST_FIRST(&dev->child_bus); for (i = 0; i < 3; i++) { uhci = pci_create_multifunction(bus, PCI_DEVFN(slot, comp[i].func), true, comp[i].name); - qdev_prop_set_string(&uhci->qdev, "masterbus", usbbus->name); - qdev_prop_set_uint32(&uhci->qdev, "firstport", comp[i].port); - qdev_init_nofail(&uhci->qdev); + dev = DEVICE(uhci); + qdev_prop_set_string(dev, "masterbus", usbbus->name); + qdev_prop_set_uint32(dev, "firstport", comp[i].port); + qdev_init_nofail(dev); } return 0; } diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 51241cd..62c08ee 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -1857,7 +1857,7 @@ static int usb_ohci_initfn_pci(struct PCIDevice *dev) ohci->pci_dev.config[PCI_CLASS_PROG] = 0x10; /* OHCI */ ohci->pci_dev.config[PCI_INTERRUPT_PIN] = 0x01; /* interrupt pin A */ - if (usb_ohci_init(&ohci->state, &dev->qdev, ohci->num_ports, 0, + if (usb_ohci_init(&ohci->state, DEVICE(dev), ohci->num_ports, 0, ohci->masterbus, ohci->firstport, pci_dma_context(dev)) != 0) { return -1; diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index c85b203..67c13c3 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -1246,7 +1246,7 @@ static int usb_uhci_common_initfn(PCIDevice *dev) return -1; } } else { - usb_bus_new(&s->bus, &uhci_bus_ops, &s->dev.qdev); + usb_bus_new(&s->bus, &uhci_bus_ops, DEVICE(dev)); for (i = 0; i < NB_PORTS; i++) { usb_register_port(&s->bus, &s->ports[i].port, s, i, &uhci_port_ops, USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL);