From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3t27-0005N9-Ph for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:23:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3t1u-0002xJ-4V for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:23:03 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53546 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3t1t-0002x9-Rm for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:22:50 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6D11EA531D for ; Mon, 29 Jul 2013 21:22:49 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 29 Jul 2013 21:20:15 +0200 Message-Id: <1375125630-24869-159-git-send-email-afaerber@suse.de> In-Reply-To: <1375125630-24869-1-git-send-email-afaerber@suse.de> References: <1375125630-24869-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 158/173] pl031: QOM cast cleanup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= Signed-off-by: Andreas F=C3=A4rber --- hw/timer/pl031.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/timer/pl031.c b/hw/timer/pl031.c index e705a69..d5e2f3e 100644 --- a/hw/timer/pl031.c +++ b/hw/timer/pl031.c @@ -33,8 +33,12 @@ do { printf("pl031: " fmt , ## __VA_ARGS__); } while (= 0) #define RTC_MIS 0x18 /* Masked interrupt status register */ #define RTC_ICR 0x1c /* Interrupt clear register */ =20 +#define TYPE_PL031 "pl031" +#define PL031(obj) OBJECT_CHECK(PL031State, (obj), TYPE_PL031) + typedef struct PL031State { - SysBusDevice busdev; + SysBusDevice parent_obj; + MemoryRegion iomem; QEMUTimer *timer; qemu_irq irq; @@ -189,7 +193,7 @@ static const MemoryRegionOps pl031_ops =3D { =20 static int pl031_init(SysBusDevice *dev) { - PL031State *s =3D FROM_SYSBUS(PL031State, dev); + PL031State *s =3D PL031(dev); struct tm tm; =20 memory_region_init_io(&s->iomem, OBJECT(s), &pl031_ops, s, "pl031", = 0x1000); @@ -251,7 +255,7 @@ static void pl031_class_init(ObjectClass *klass, void= *data) } =20 static const TypeInfo pl031_info =3D { - .name =3D "pl031", + .name =3D TYPE_PL031, .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(PL031State), .class_init =3D pl031_class_init, --=20 1.8.1.4