From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3t0s-0003db-JI for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:21:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3t0m-0002Ug-DC for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:21:46 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53383 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3t0m-0002UW-5t for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:21:40 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 29 Jul 2013 21:18:45 +0200 Message-Id: <1375125630-24869-69-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 068/173] lm32_uart: QOM cast cleanup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Michael Walle , =?UTF-8?q?Andreas=20F=C3=A4rber?= Signed-off-by: Andreas F=C3=A4rber --- hw/char/lm32_uart.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c index 37b38ba..85d7265 100644 --- a/hw/char/lm32_uart.c +++ b/hw/char/lm32_uart.c @@ -89,8 +89,12 @@ enum { MSR_DCD =3D (1<<7), }; =20 +#define TYPE_LM32_UART "lm32-uart" +#define LM32_UART(obj) OBJECT_CHECK(LM32UartState, (obj), TYPE_LM32_UART= ) + struct LM32UartState { - SysBusDevice busdev; + SysBusDevice parent_obj; + MemoryRegion iomem; CharDriverState *chr; qemu_irq irq; @@ -233,7 +237,7 @@ static void uart_event(void *opaque, int event) =20 static void uart_reset(DeviceState *d) { - LM32UartState *s =3D container_of(d, LM32UartState, busdev.qdev); + LM32UartState *s =3D LM32_UART(d); int i; =20 for (i =3D 0; i < R_MAX; i++) { @@ -246,7 +250,7 @@ static void uart_reset(DeviceState *d) =20 static int lm32_uart_init(SysBusDevice *dev) { - LM32UartState *s =3D FROM_SYSBUS(typeof(*s), dev); + LM32UartState *s =3D LM32_UART(dev); =20 sysbus_init_irq(dev, &s->irq); =20 @@ -284,7 +288,7 @@ static void lm32_uart_class_init(ObjectClass *klass, = void *data) } =20 static const TypeInfo lm32_uart_info =3D { - .name =3D "lm32-uart", + .name =3D TYPE_LM32_UART, .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(LM32UartState), .class_init =3D lm32_uart_class_init, --=20 1.8.1.4