mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
hw: cannot_instantiate_with_device_add_yet due to pointer props
Pointer properties can be set only by code, not by device_add. A device with a pointer property can work with device_add only when the property may remain null. This is the case for property "interrupt_vector" of device "etraxfs,pic". Add a comment there. Set cannot_instantiate_with_device_add_yet for the other devices with pointer properties, with a comment explaining why. Juha Riihimäki and Peter Maydell deserve my thanks for making "pointer property must not remain null" blatantly obvious in the OMAP devices. Only device "smbus-eeprom" is actually changed. The others are all sysbus devices, which get cannot_instantiate_with_device_add_yet set in their abstract base's class init function. Setting it again in their class init function is technically redundant, but serves as insurance for when sysbus devices become available with device_add, and as documentation. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> (for ETRAX) Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
061e84f7a4
commit
1b111dc121
10 changed files with 26 additions and 0 deletions
|
@ -759,6 +759,8 @@ static void omap_gpio_class_init(ObjectClass *klass, void *data)
|
|||
k->init = omap_gpio_init;
|
||||
dc->reset = omap_gpif_reset;
|
||||
dc->props = omap_gpio_properties;
|
||||
/* Reason: pointer property "clk" */
|
||||
dc->cannot_instantiate_with_device_add_yet = true;
|
||||
}
|
||||
|
||||
static const TypeInfo omap_gpio_info = {
|
||||
|
@ -788,6 +790,8 @@ static void omap2_gpio_class_init(ObjectClass *klass, void *data)
|
|||
k->init = omap2_gpio_init;
|
||||
dc->reset = omap2_gpif_reset;
|
||||
dc->props = omap2_gpio_properties;
|
||||
/* Reason: pointer properties "iclk", "fclk0", ..., "fclk5" */
|
||||
dc->cannot_instantiate_with_device_add_yet = true;
|
||||
}
|
||||
|
||||
static const TypeInfo omap2_gpio_info = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue