2011/10/19 Benoît Canet <benoit.ca...@gmail.com>: > +static int icp_control_init(SysBusDevice *dev) > { > - MemoryRegion *io; > + icp_control_state *s = FROM_SYSBUS(icp_control_state, dev); > > - io = (MemoryRegion *)g_malloc0(sizeof(MemoryRegion)); > - memory_region_init_io(io, &icp_control_ops, NULL, > + memory_region_init_io(&s->iomem, &icp_control_ops, s, > "control", 0x00800000); > - memory_region_add_subregion(get_system_memory(), base, io); > + sysbus_init_mmio_region(dev, &s->iomem); > /* ??? Save/restore. */ > + return 0; > }
You should delete the "??? Save/restore" comment -- the device currently has no state it needs to save/restore, and now it's a sysbus device we have an easy path to add save/restore if we do add state (ie we can at that point give it a vmstate). Otherwise looks good. -- PMM