From patchwork Mon Jun 24 07:06:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 253681 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 3941E2C016A for ; Mon, 24 Jun 2013 17:13:31 +1000 (EST) Received: from localhost ([::1]:36202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur0xq-0003YH-T7 for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2013 03:13:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur0xS-0003QN-S5 for qemu-devel@nongnu.org; Mon, 24 Jun 2013 03:13:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ur0xR-0000z5-Ol for qemu-devel@nongnu.org; Mon, 24 Jun 2013 03:13:02 -0400 Received: from mail-pb0-x234.google.com ([2607:f8b0:400e:c01::234]:41536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur0xR-0000yw-Hl for qemu-devel@nongnu.org; Mon, 24 Jun 2013 03:13:01 -0400 Received: by mail-pb0-f52.google.com with SMTP id xa12so10480615pbc.25 for ; Mon, 24 Jun 2013 00:13:00 -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=jNbJlBUFCjOi1iPL6yIDA5KykTuAwrz4EEchb6NRnF8=; b=eJi+RlMWQ1FnxMDannNuIDU8+AYSt4u0fQysPwnZRjeoRYU1bpT5YNsmd0RqnXIi5q QRViGsONro4/RwLPTLYyMTl5R1vf0kg/JS/aXr+UEbYrtxPsjYrb0uZ780458g6gtsam /bxhRy5UHEHG3kYIZOAI8x3WJPsHH0iR7NM08SbWuGHp2FriRXHZcF1Qb1biEnhzlQqM LVDkUWCX2hH+T5Z0jztY7OY9asO9hZs+arte52OvyLDjG88/D27+4TeDuzRZT7TxWXWX mEe+oI3K81WSgdXk/fY/DxP3Rg8lhWSdMEIFY0y453gUU0+2upn3+KknpB0E5nBJAPKe gyDQ== X-Received: by 10.68.178.229 with SMTP id db5mr22319731pbc.79.1372057980845; Mon, 24 Jun 2013 00:13:00 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id fr1sm16814668pbb.26.2013.06.24.00.12.55 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 24 Jun 2013 00:13:00 -0700 (PDT) From: peter.crosthwaite@xilinx.com To: qemu-devel@nongnu.org Date: Mon, 24 Jun 2013 17:06:58 +1000 Message-Id: <7cc26bf76f027f0e12f74ca0c4dbc1785208f582.1372055322.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: ALoCoQk1FFNgULL4Sj0mNvj4jC8bGDI8ZVHvqt3hnEm+7SQlJjZcOWTSdKDcMMlU/eV0rILzPXhw X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::234 Cc: pbonzini@redhat.com, afaerber@suse.de, mst@redhat.com Subject: [Qemu-devel] [PATCH v2 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 f1b5f5d..998a9bf 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 5513924..2f88db6 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_get_address_space(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);