From patchwork Mon Jun 24 07:05:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 253679 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 A74222C016A for ; Mon, 24 Jun 2013 17:12:02 +1000 (EST) Received: from localhost ([::1]:33268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur0wQ-0000Mp-RO for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2013 03:11:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur0w1-0000IG-Ti for qemu-devel@nongnu.org; Mon, 24 Jun 2013 03:11:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ur0w0-0000m1-GF for qemu-devel@nongnu.org; Mon, 24 Jun 2013 03:11:33 -0400 Received: from mail-pb0-x233.google.com ([2607:f8b0:400e:c01::233]:47117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur0w0-0000lq-8D for qemu-devel@nongnu.org; Mon, 24 Jun 2013 03:11:32 -0400 Received: by mail-pb0-f51.google.com with SMTP id um15so10535940pbc.38 for ; Mon, 24 Jun 2013 00:11:31 -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=RQkYob8zuYwAZstSkB9tQBxUnJ6RGy1o93eb2ocoygk=; b=bCpOF2wAUSQP1IiJ47hb7gvKEEI3TCF81b67KYF5QAYRnBcKRB7KC0WiAwItXVMawK GAfXYeqvKQCz1NPJL88I2SwG18AmHbP0LeTWffuBQExpaDHsd1EAhXzgdWY6hFsvA0Z7 z0js6nNlyo9dq2hVp1Jg76ZfBMc8dyf4dZ+0C8Pl9Gsf8NU0H/qod1Rofy+Oel1x73eK 4fi1n2yz8GUf9vOdQGwVF+4UMbeyNnYxs1d6vm+e0CyT0lCukUtKMi504VpFDihZrSWf 6AlerfFImCZ9nHISmuaIu1aTXVSA4ATCAi7tupq+FExMhS+TXqJxCa2QTyP1dZUa1RJp tKdA== X-Received: by 10.66.222.226 with SMTP id qp2mr20836033pac.102.1372057891556; Mon, 24 Jun 2013 00:11:31 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id v20sm18505012paj.4.2013.06.24.00.11.26 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 24 Jun 2013 00:11:30 -0700 (PDT) From: peter.crosthwaite@xilinx.com To: qemu-devel@nongnu.org Date: Mon, 24 Jun 2013 17:05:28 +1000 Message-Id: <41438b2392310357a6af2fc52af572381e2321da.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: ALoCoQnfeYf1WftP3GdSRnKfosAgTQlMdVstycc/vI2Sg1qrGfVZJUJ4cOE0hxndq5kqrQ5n9oYb X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::233 Cc: pbonzini@redhat.com, afaerber@suse.de, mst@redhat.com Subject: [Qemu-devel] [PATCH v2 21/30] net/eepro100: 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/net/eepro100.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index dc99ea6..f34b5dc 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -1842,13 +1842,14 @@ static void nic_cleanup(NetClientState *nc) static void pci_nic_uninit(PCIDevice *pci_dev) { + DeviceState *d = DEVICE(pci_dev); EEPRO100State *s = DO_UPCAST(EEPRO100State, dev, pci_dev); memory_region_destroy(&s->mmio_bar); memory_region_destroy(&s->io_bar); memory_region_destroy(&s->flash_bar); - vmstate_unregister(&pci_dev->qdev, s->vmstate, s); - eeprom93xx_free(&pci_dev->qdev, s->eeprom); + vmstate_unregister(d, s->vmstate, s); + eeprom93xx_free(d, s->eeprom); qemu_del_nic(s->nic); } @@ -1862,6 +1863,7 @@ static NetClientInfo net_eepro100_info = { static int e100_nic_init(PCIDevice *pci_dev) { + DeviceState *d = DEVICE(pci_dev); EEPRO100State *s = DO_UPCAST(EEPRO100State, dev, pci_dev); E100PCIDeviceInfo *info = eepro100_get_class(s); @@ -1873,7 +1875,7 @@ static int e100_nic_init(PCIDevice *pci_dev) /* Add 64 * 2 EEPROM. i82557 and i82558 support a 64 word EEPROM, * i82559 and later support 64 or 256 word EEPROM. */ - s->eeprom = eeprom93xx_new(&pci_dev->qdev, EEPROM_SIZE); + s->eeprom = eeprom93xx_new(d, EEPROM_SIZE); /* Handler for memory-mapped I/O */ memory_region_init_io(&s->mmio_bar, &eepro100_ops, s, "eepro100-mmio", @@ -1893,7 +1895,7 @@ static int e100_nic_init(PCIDevice *pci_dev) nic_reset(s); s->nic = qemu_new_nic(&net_eepro100_info, &s->conf, - object_get_typename(OBJECT(pci_dev)), pci_dev->qdev.id, s); + object_get_typename(OBJECT(pci_dev)), d->id, s); qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a); TRACE(OTHER, logout("%s\n", qemu_get_queue(s->nic)->info_str)); @@ -1903,9 +1905,9 @@ static int e100_nic_init(PCIDevice *pci_dev) s->vmstate = g_malloc(sizeof(vmstate_eepro100)); memcpy(s->vmstate, &vmstate_eepro100, sizeof(vmstate_eepro100)); s->vmstate->name = qemu_get_queue(s->nic)->model; - vmstate_register(&pci_dev->qdev, -1, s->vmstate, s); + vmstate_register(d, -1, s->vmstate, s); - add_boot_device_path(s->conf.bootindex, &pci_dev->qdev, "/ethernet-phy@0"); + add_boot_device_path(s->conf.bootindex, d, "/ethernet-phy@0"); return 0; }