diff options
author | Andreas Färber <afaerber@suse.de> | 2013-07-24 22:59:55 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-07-29 21:06:28 +0200 |
commit | 85f3d3024588d27453788167566c34c3c658881d (patch) | |
tree | 2ac16ddeb933021774489d88bae8f8abb900b885 /hw/char/lm32_uart.c | |
parent | a0b97927e34903ed280250f90deb6d3261cdc62f (diff) |
lm32_uart: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/char/lm32_uart.c')
-rw-r--r-- | hw/char/lm32_uart.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c index 37b38ba4ed..85d726508b 100644 --- a/hw/char/lm32_uart.c +++ b/hw/char/lm32_uart.c @@ -89,8 +89,12 @@ enum { MSR_DCD = (1<<7), }; +#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) static void uart_reset(DeviceState *d) { - LM32UartState *s = container_of(d, LM32UartState, busdev.qdev); + LM32UartState *s = LM32_UART(d); int i; for (i = 0; i < R_MAX; i++) { @@ -246,7 +250,7 @@ static void uart_reset(DeviceState *d) static int lm32_uart_init(SysBusDevice *dev) { - LM32UartState *s = FROM_SYSBUS(typeof(*s), dev); + LM32UartState *s = LM32_UART(dev); sysbus_init_irq(dev, &s->irq); @@ -284,7 +288,7 @@ static void lm32_uart_class_init(ObjectClass *klass, void *data) } static const TypeInfo lm32_uart_info = { - .name = "lm32-uart", + .name = TYPE_LM32_UART, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(LM32UartState), .class_init = lm32_uart_class_init, |