Skip to content

Commit

Permalink
lm32_uart: QOM cast cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Färber <afaerber@suse.de>
  • Loading branch information
afaerber committed Jul 29, 2013
1 parent a0b9792 commit 85f3d30
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions hw/char/lm32_uart.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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++) {
Expand All @@ -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);

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 85f3d30

Please sign in to comment.