From patchwork Tue Jun 11 06:54:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 250467 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 3B6982C007E for ; Tue, 11 Jun 2013 17:00:08 +1000 (EST) Received: from localhost ([::1]:43420 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmIYo-0000CZ-Ez for incoming@patchwork.ozlabs.org; Tue, 11 Jun 2013 03:00:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmIYN-0008GL-1j for qemu-devel@nongnu.org; Tue, 11 Jun 2013 02:59:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmIYL-0000Ht-UA for qemu-devel@nongnu.org; Tue, 11 Jun 2013 02:59:38 -0400 Received: from mail-pb0-x22f.google.com ([2607:f8b0:400e:c01::22f]:55746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmIYL-0000Hi-JE for qemu-devel@nongnu.org; Tue, 11 Jun 2013 02:59:37 -0400 Received: by mail-pb0-f47.google.com with SMTP id rr13so5446231pbb.6 for ; Mon, 10 Jun 2013 23:59:36 -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=vGnfAWhBJlawbwnxTe3JCpcAu7z+tp5W17aOkU+pgS4=; b=PrppU7Z5sqUmZipV3k4/WNcbr8czxhxmcUfL6mprfaANydNHiN1KY0ovOICGeAGaea oQXf3hduwyzrXDFh+O+uiPwWzNOyWdd+W0ee/vLVokyvl2T2byGCNnLv8a79ReWgh0ZW T7KLzth7j9ctSXqsk7C+GUYuK+8B42Ssi0RZaxcGI+0mhe3srzzbXfWw4uqPBtV2Xmqz J+cFnI6x53QsKU/NtFOQ5vSWEYVdMKTqtO38B1PIT8By0xpB/nqFHA4nAuahY6Aln8QX tJ77XVHmgNEIW7mogUZ5E01enrOib2u5+g7QCuEHr8S2OvENro5QNJDKO79EjshgQrwa rfpQ== X-Received: by 10.66.197.201 with SMTP id iw9mr5761971pac.198.1370933976705; Mon, 10 Jun 2013 23:59:36 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id yj2sm13423189pbb.40.2013.06.10.23.59.30 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 10 Jun 2013 23:59:35 -0700 (PDT) From: peter.crosthwaite@xilinx.com To: qemu-devel@nongnu.org Date: Tue, 11 Jun 2013 16:54:26 +1000 Message-Id: <11d9fd2f10a5154766304828f6844047bce81008.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: ALoCoQkG3KnPn1LFCdkskwwoODaYzlptIGwhURY2kARef9bhHk3PmdIVehRiNkq1sj/0ntXDbvwV X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::22f Cc: pbonzini@redhat.com, aliguori@us.ibm.com, afaerber@suse.de Subject: [Qemu-devel] [RFT PATCH v1 19/30] pci-bridge/*: 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/pci-bridge/i82801b11.c | 2 +- hw/pci-bridge/ioh3420.c | 2 +- hw/pci-bridge/xio3130_downstream.c | 2 +- hw/pci-bridge/xio3130_upstream.c | 2 +- hw/pci/pci_bridge.c | 7 ++++--- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c index 5807a92..8b20e27 100644 --- a/hw/pci-bridge/i82801b11.c +++ b/hw/pci-bridge/i82801b11.c @@ -108,7 +108,7 @@ PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus) return NULL; } br = DO_UPCAST(PCIBridge, dev, d); - qdev = &br->dev.qdev; + qdev = DEVICE(br); snprintf(buf, sizeof(buf), "pci.%d", sec_bus); pci_bridge_map_irq(br, buf, pci_swizzle_map_irq_fn); diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c index bb541eb..32f9ed6 100644 --- a/hw/pci-bridge/ioh3420.c +++ b/hw/pci-bridge/ioh3420.c @@ -173,7 +173,7 @@ PCIESlot *ioh3420_init(PCIBus *bus, int devfn, bool multifunction, } br = DO_UPCAST(PCIBridge, dev, d); - qdev = &br->dev.qdev; + qdev = DEVICE(br); pci_bridge_map_irq(br, bus_name, map_irq); qdev_prop_set_uint8(qdev, "port", port); qdev_prop_set_uint8(qdev, "chassis", chassis); diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c index 1810dd2..6a799e2 100644 --- a/hw/pci-bridge/xio3130_downstream.c +++ b/hw/pci-bridge/xio3130_downstream.c @@ -140,7 +140,7 @@ PCIESlot *xio3130_downstream_init(PCIBus *bus, int devfn, bool multifunction, } br = DO_UPCAST(PCIBridge, dev, d); - qdev = &br->dev.qdev; + qdev = DEVICE(br); pci_bridge_map_irq(br, bus_name, map_irq); qdev_prop_set_uint8(qdev, "port", port); qdev_prop_set_uint8(qdev, "chassis", chassis); diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c index 8e0d97a..9bb9daa 100644 --- a/hw/pci-bridge/xio3130_upstream.c +++ b/hw/pci-bridge/xio3130_upstream.c @@ -120,7 +120,7 @@ PCIEPort *xio3130_upstream_init(PCIBus *bus, int devfn, bool multifunction, } br = DO_UPCAST(PCIBridge, dev, d); - qdev = &br->dev.qdev; + qdev = DEVICE(br); pci_bridge_map_irq(br, bus_name, map_irq); qdev_prop_set_uint8(qdev, "port", port); qdev_init_nofail(qdev); diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c index 24be6c5..f6657e8 100644 --- a/hw/pci/pci_bridge.c +++ b/hw/pci/pci_bridge.c @@ -330,6 +330,7 @@ void pci_bridge_reset(DeviceState *qdev) /* default qdev initialization function for PCI-to-PCI bridge */ int pci_bridge_initfn(PCIDevice *dev, const char *typename) { + DeviceState *d = DEVICE(dev); PCIBus *parent = dev->bus; PCIBridge *br = DO_UPCAST(PCIBridge, dev, dev); PCIBus *sec_bus = &br->sec_bus; @@ -359,11 +360,11 @@ int pci_bridge_initfn(PCIDevice *dev, const char *typename) * Since PCI Bridge devices have a single bus each, we don't need the index: * let users address the bus using the device name. */ - if (!br->bus_name && dev->qdev.id && *dev->qdev.id) { - br->bus_name = dev->qdev.id; + if (!br->bus_name && d->id && *d->id) { + br->bus_name = d->id; } - qbus_create_inplace(&sec_bus->qbus, typename, &dev->qdev, br->bus_name); + qbus_create_inplace(&sec_bus->qbus, typename, d, br->bus_name); sec_bus->parent_dev = dev; sec_bus->map_irq = br->map_irq ? br->map_irq : pci_swizzle_map_irq_fn; sec_bus->address_space_mem = &br->address_space_mem;