From patchwork Sun Jun 30 01:44:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 255841 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 DC9482C02F2 for ; Sun, 30 Jun 2013 11:54:27 +1000 (EST) Received: from localhost ([::1]:35088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ut6qQ-0001O8-2J for incoming@patchwork.ozlabs.org; Sat, 29 Jun 2013 21:54:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ut6hd-0003cq-Tm for qemu-devel@nongnu.org; Sat, 29 Jun 2013 21:45:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ut6hY-0007dV-Cx for qemu-devel@nongnu.org; Sat, 29 Jun 2013 21:45:21 -0400 Received: from cantor2.suse.de ([195.135.220.15]:37006 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ut6hY-0007cW-6S; Sat, 29 Jun 2013 21:45:16 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id AFFA1A5388; Sun, 30 Jun 2013 03:45:14 +0200 (CEST) From: Alexander Graf To: qemu-ppc@nongnu.org Date: Sun, 30 Jun 2013 03:44:50 +0200 Message-Id: <1372556709-23868-14-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1372556709-23868-1-git-send-email-agraf@suse.de> References: <1372556709-23868-1-git-send-email-agraf@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: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH 13/32] mpc8544_guts: 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 From: Andreas Färber Introduce type constant, cast macro and rename parent field. Signed-off-by: Andreas Färber Signed-off-by: Alexander Graf --- hw/ppc/mpc8544_guts.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c index 98540a4..f623b04 100644 --- a/hw/ppc/mpc8544_guts.c +++ b/hw/ppc/mpc8544_guts.c @@ -51,8 +51,14 @@ #define MPC8544_GUTS_ADDR_SRDS2CR1 0xF10 #define MPC8544_GUTS_ADDR_SRDS2CR3 0xF18 +#define TYPE_MPC8544_GUTS "mpc8544-guts" +#define MPC8544_GUTS(obj) OBJECT_CHECK(GutsState, (obj), TYPE_MPC8544_GUTS) + struct GutsState { - SysBusDevice busdev; + /*< private >*/ + SysBusDevice parent_obj; + /*< public >*/ + MemoryRegion iomem; }; @@ -110,9 +116,7 @@ static const MemoryRegionOps mpc8544_guts_ops = { static int mpc8544_guts_initfn(SysBusDevice *dev) { - GutsState *s; - - s = FROM_SYSBUS(GutsState, SYS_BUS_DEVICE(dev)); + GutsState *s = MPC8544_GUTS(dev); memory_region_init_io(&s->iomem, &mpc8544_guts_ops, s, "mpc8544.guts", MPC8544_GUTS_MMIO_SIZE); @@ -129,7 +133,7 @@ static void mpc8544_guts_class_init(ObjectClass *klass, void *data) } static const TypeInfo mpc8544_guts_info = { - .name = "mpc8544-guts", + .name = TYPE_MPC8544_GUTS, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(GutsState), .class_init = mpc8544_guts_class_init,