From patchwork Mon Jun 24 07:03: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: 253677 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 DB9672C016A for ; Mon, 24 Jun 2013 17:10:29 +1000 (EST) Received: from localhost ([::1]:58569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur0ux-0006NC-U9 for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2013 03:10:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur0uZ-0006Hy-Ob for qemu-devel@nongnu.org; Mon, 24 Jun 2013 03:10:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ur0uY-00005o-Lb for qemu-devel@nongnu.org; Mon, 24 Jun 2013 03:10:03 -0400 Received: from mail-pb0-x230.google.com ([2607:f8b0:400e:c01::230]:37661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur0uY-0008Ud-FQ for qemu-devel@nongnu.org; Mon, 24 Jun 2013 03:10:02 -0400 Received: by mail-pb0-f48.google.com with SMTP id ma3so10480018pbc.21 for ; Mon, 24 Jun 2013 00:10:01 -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=0mqeSXMtJvUTsqEYSIfdtJaT5xs18lZNjpgzdhFv5Xc=; b=e8TAgcEDRApm5CMGyg2co+otukcX6/11YUmWkXiww2XyNaJ0CbupgqVGHJKfcWVLa4 jekioNvb7NEyPfGlCU2NGer7K6d6kP4QXKgUvADhqUNTyeeOaUIefR9fyqF+yRf8gGoH k7v0NZMh5PypAGSx7AQS9IjXtWNaFvCqkto7UqqCWG2RDHq25pEmCLohD+/liGxm3w3u RImpyDCZtYglpLv/qaoJe/4R9RySTYPmYNXrtPrzBerqB3V0/bQiFoMXpJlV6bNL4gMu 5J27tAzK4Jtce/xLue6/P0jx/l9KqNbSHFcdcBVYI3vuJhmMO2+nlGFZHmzSJbtuGGur pkEw== X-Received: by 10.68.141.14 with SMTP id rk14mr22832559pbb.1.1372057801779; Mon, 24 Jun 2013 00:10:01 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id xu10sm18504721pab.3.2013.06.24.00.09.56 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 24 Jun 2013 00:10:01 -0700 (PDT) From: peter.crosthwaite@xilinx.com To: qemu-devel@nongnu.org Date: Mon, 24 Jun 2013 17:03:58 +1000 Message-Id: <718cf2428e8ef4dcc79b53b15d27a0a529bfc3ef.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: ALoCoQlPd5vhVtqBMZZcdxbTXru6BUCxtYPh+I6OovcCokHy8MLEq4LuFqXxaQPR+vKDCH3ioAi4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::230 Cc: pbonzini@redhat.com, afaerber@suse.de, mst@redhat.com Subject: [Qemu-devel] [PATCH v2 19/30] pci/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/pci_bridge.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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;