From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3t16-00044m-OU for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:22:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3t0x-0002Zd-Ga for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:22:00 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53407 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3t0x-0002ZV-Ar for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:21:51 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 29 Jul 2013 21:19:00 +0200 Message-Id: <1375125630-24869-84-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 083/173] puv3_gpio: QOM cast cleanup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Guan Xuetao , =?UTF-8?q?Andreas=20F=C3=A4rber?= Signed-off-by: Andreas F=C3=A4rber --- hw/gpio/puv3_gpio.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/gpio/puv3_gpio.c b/hw/gpio/puv3_gpio.c index 18671eb..39840aa 100644 --- a/hw/gpio/puv3_gpio.c +++ b/hw/gpio/puv3_gpio.c @@ -14,8 +14,12 @@ #undef DEBUG_PUV3 #include "hw/unicore32/puv3.h" =20 -typedef struct { - SysBusDevice busdev; +#define TYPE_PUV3_GPIO "puv3_gpio" +#define PUV3_GPIO(obj) OBJECT_CHECK(PUV3GPIOState, (obj), TYPE_PUV3_GPIO= ) + +typedef struct PUV3GPIOState { + SysBusDevice parent_obj; + MemoryRegion iomem; qemu_irq irq[9]; =20 @@ -96,7 +100,7 @@ static const MemoryRegionOps puv3_gpio_ops =3D { =20 static int puv3_gpio_init(SysBusDevice *dev) { - PUV3GPIOState *s =3D FROM_SYSBUS(PUV3GPIOState, dev); + PUV3GPIOState *s =3D PUV3_GPIO(dev); =20 s->reg_GPLR =3D 0; s->reg_GPDR =3D 0; @@ -127,7 +131,7 @@ static void puv3_gpio_class_init(ObjectClass *klass, = void *data) } =20 static const TypeInfo puv3_gpio_info =3D { - .name =3D "puv3_gpio", + .name =3D TYPE_PUV3_GPIO, .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(PUV3GPIOState), .class_init =3D puv3_gpio_class_init, --=20 1.8.1.4