From patchwork Sat Apr 27 20:18:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 240196 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 79E132C00B0 for ; Sun, 28 Apr 2013 06:45:42 +1000 (EST) Received: from localhost ([::1]:42578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWBco-0004Cy-1z for incoming@patchwork.ozlabs.org; Sat, 27 Apr 2013 16:21:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWBaZ-0000ab-AI for qemu-devel@nongnu.org; Sat, 27 Apr 2013 16:19:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWBaU-000246-3j for qemu-devel@nongnu.org; Sat, 27 Apr 2013 16:19:19 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41909 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWBaT-00023P-U8 for qemu-devel@nongnu.org; Sat, 27 Apr 2013 16:19:14 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 852805E00020A for ; Sat, 27 Apr 2013 22:19:13 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sat, 27 Apr 2013 22:18:44 +0200 Message-Id: <1367093935-29091-10-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1367093935-29091-1-git-send-email-afaerber@suse.de> References: <1367093935-29091-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH for-1.5 v2 09/20] ne2000-isa: QOM'ify 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 Introduce type constant and cast macro to obsolete DO_UPCAST(). Prepares for ISA realizefn. Signed-off-by: Andreas Färber --- hw/net/ne2000-isa.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index a093aa8..f8e610c 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,