aboutsummaryrefslogtreecommitdiff
path: root/hw/net
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-04-27 22:18:44 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2013-04-29 08:27:48 -0500
commitfe6f5deb6611c512abcb4cb46a275756295b3e79 (patch)
tree7065a9a0e924d5b0094c20cad60b5629a6c94a9b /hw/net
parent0e41271ec4944ea5b63c98b8e497618709e954c3 (diff)
ne2000-isa: QOM'ify
Introduce type constant and cast macro to obsolete DO_UPCAST(). Prepares for ISA realizefn. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1367093935-29091-10-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/net')
-rw-r--r--hw/net/ne2000-isa.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c
index a093aa8bea..f8e610cfa2 100644
--- a/hw/net/ne2000-isa.c
+++ b/hw/net/ne2000-isa.c
@@ -29,8 +29,12 @@
#include "ne2000.h"
#include "exec/address-spaces.h"
+#define TYPE_ISA_NE2000 "ne2k_isa"
+#define ISA_NE2000(obj) OBJECT_CHECK(ISANE2000State, (obj), TYPE_ISA_NE2000)
+
typedef struct ISANE2000State {
- ISADevice dev;
+ ISADevice parent_obj;
+
uint32_t iobase;
uint32_t isairq;
NE2000State ne2000;
@@ -64,7 +68,7 @@ static const VMStateDescription vmstate_isa_ne2000 = {
static int isa_ne2000_initfn(ISADevice *dev)
{
- ISANE2000State *isa = DO_UPCAST(ISANE2000State, dev, dev);
+ ISANE2000State *isa = ISA_NE2000(dev);
NE2000State *s = &isa->ne2000;
ne2000_setup_io(s, 0x20);
@@ -98,7 +102,7 @@ static void isa_ne2000_class_initfn(ObjectClass *klass, void *data)
}
static const TypeInfo ne2000_isa_info = {
- .name = "ne2k_isa",
+ .name = TYPE_ISA_NE2000,
.parent = TYPE_ISA_DEVICE,
.instance_size = sizeof(ISANE2000State),
.class_init = isa_ne2000_class_initfn,