hw/sd/milkymist: Create the SDBus at init()
We don't need to wait until realize() to create the SDBus, create it in init() directly. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20200705211016.15241-4-f4bug@amsat.org>
This commit is contained in:
parent
3dce584241
commit
ae7ba8e04a
@ -261,6 +261,9 @@ static void milkymist_memcard_init(Object *obj)
|
||||
memory_region_init_io(&s->regs_region, OBJECT(s), &memcard_mmio_ops, s,
|
||||
"milkymist-memcard", R_MAX * 4);
|
||||
sysbus_init_mmio(dev, &s->regs_region);
|
||||
|
||||
qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS,
|
||||
DEVICE(obj), "sd-bus");
|
||||
}
|
||||
|
||||
static void milkymist_memcard_realize(DeviceState *dev, Error **errp)
|
||||
@ -271,9 +274,6 @@ static void milkymist_memcard_realize(DeviceState *dev, Error **errp)
|
||||
DriveInfo *dinfo;
|
||||
Error *err = NULL;
|
||||
|
||||
qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS,
|
||||
dev, "sd-bus");
|
||||
|
||||
/* Create and plug in the sd card */
|
||||
/* FIXME use a qdev drive property instead of drive_get_next() */
|
||||
dinfo = drive_get_next(IF_SD);
|
||||
|
Loading…
x
Reference in New Issue
Block a user