On Sun, Jul 21, 2013 at 11:35:55AM +0200, Andreas Färber wrote: > Am 01.07.2013 12:18, schrieb Hu Tao: > > Signed-off-by: Hu Tao <hu...@cn.fujitsu.com> > > --- > > hw/nvram/fw_cfg.c | 26 ++++++++++++++++---------- > > 1 file changed, 16 insertions(+), 10 deletions(-) > > > > diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c > > index c8722c2..656ffcc 100644 > > --- a/hw/nvram/fw_cfg.c > > +++ b/hw/nvram/fw_cfg.c > > @@ -523,31 +523,37 @@ FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t > > data_port, > > return s; > > } > > > > -static int fw_cfg_init1(SysBusDevice *dev) > > +static void fw_cfg_initfn(Object *obj) > > { > > - FWCfgState *s = FW_CFG(dev); > > + FWCfgState *s = FW_CFG(obj); > > > > memory_region_init_io(&s->ctl_iomem, &fw_cfg_ctl_mem_ops, s, > > "fwcfg.ctl", FW_CFG_SIZE); > > - sysbus_init_mmio(dev, &s->ctl_iomem); > > memory_region_init_io(&s->data_iomem, &fw_cfg_data_mem_ops, s, > > "fwcfg.data", FW_CFG_DATA_SIZE); > > - sysbus_init_mmio(dev, &s->data_iomem); > > /* In case ctl and data overlap: */ > > memory_region_init_io(&s->comb_iomem, &fw_cfg_comb_mem_ops, s, > > "fwcfg", FW_CFG_SIZE); > > +} > > There's no reason not to have sysbus_init_mmio() in instance_init, > changed that.
Thanks.