ssi: Added create_slave_no_init()

Slave creation function that can be used to create an SSI slave without
qdev_init() being called. This give machine models a chance to set properties.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter A. G. Crosthwaite 2012-07-24 13:56:27 +10:00 committed by Peter Crosthwaite
parent 6653095331
commit 74687e40b0
2 changed files with 8 additions and 2 deletions

View File

@ -86,10 +86,15 @@ static TypeInfo ssi_slave_info = {
.abstract = true,
};
DeviceState *ssi_create_slave_no_init(SSIBus *bus, const char *name)
{
return qdev_create(&bus->qbus, name);
}
DeviceState *ssi_create_slave(SSIBus *bus, const char *name)
{
DeviceState *dev;
dev = qdev_create(&bus->qbus, name);
DeviceState *dev = ssi_create_slave_no_init(bus, name);
qdev_init_nofail(dev);
return dev;
}

View File

@ -76,6 +76,7 @@ extern const VMStateDescription vmstate_ssi_slave;
}
DeviceState *ssi_create_slave(SSIBus *bus, const char *name);
DeviceState *ssi_create_slave_no_init(SSIBus *bus, const char *name);
/* Master interface. */
SSIBus *ssi_create_bus(DeviceState *parent, const char *name);