Revision f1a0a79f

b/hw/misc/slavio_misc.c
57 57
    uint16_t leds;
58 58
} MiscState;
59 59

  
60
#define TYPE_APC "apc"
61
#define APC(obj) OBJECT_CHECK(APCState, (obj), TYPE_APC)
62

  
60 63
typedef struct APCState {
61
    SysBusDevice busdev;
64
    SysBusDevice parent_obj;
65

  
62 66
    MemoryRegion iomem;
63 67
    qemu_irq cpu_halt;
64 68
} APCState;
......
411 415

  
412 416
static int apc_init1(SysBusDevice *dev)
413 417
{
414
    APCState *s = FROM_SYSBUS(APCState, dev);
418
    APCState *s = APC(dev);
415 419

  
416 420
    sysbus_init_irq(dev, &s->cpu_halt);
417 421

  
......
498 502
}
499 503

  
500 504
static const TypeInfo apc_info = {
501
    .name          = "apc",
505
    .name          = TYPE_APC,
502 506
    .parent        = TYPE_SYS_BUS_DEVICE,
503 507
    .instance_size = sizeof(MiscState),
504 508
    .class_init    = apc_class_init,

Also available in: Unified diff