Patchwork [v2,22/30] net/ne2000: substitute ->qdev casts with DEVICE()

login
register
mail settings
Submitter Peter Crosthwaite
Date June 24, 2013, 7:06 a.m.
Message ID <e5de83fbaac3651c5c3a044636ebca3bcb0a41ed.1372055322.git.peter.crosthwaite@xilinx.com>
Download mbox | patch
Permalink /patch/253680/
State New
Headers show

Comments

Peter Crosthwaite - June 24, 2013, 7:06 a.m.
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---

 hw/net/ne2000.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 33ee03e..70a7991 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -722,6 +722,8 @@  static NetClientInfo net_ne2000_info = {
 static int pci_ne2000_init(PCIDevice *pci_dev)
 {
     PCINE2000State *d = DO_UPCAST(PCINE2000State, dev, pci_dev);
+    DeviceState *ds = DEVICE(pci_dev);
+
     NE2000State *s;
     uint8_t *pci_conf;
 
@@ -737,10 +739,10 @@  static int pci_ne2000_init(PCIDevice *pci_dev)
     ne2000_reset(s);
 
     s->nic = qemu_new_nic(&net_ne2000_info, &s->c,
-                          object_get_typename(OBJECT(pci_dev)), pci_dev->qdev.id, s);
+                          object_get_typename(OBJECT(pci_dev)), ds->id, s);
     qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
 
-    add_boot_device_path(s->c.bootindex, &pci_dev->qdev, "/ethernet-phy@0");
+    add_boot_device_path(s->c.bootindex, ds, "/ethernet-phy@0");
 
     return 0;
 }