hw/arm/raspi: Avoid using TypeInfo::class_data pointer
commitf0eeb4b6154a33950e0ea887a2678053234f7a5f
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Thu, 24 Sep 2020 11:18:04 +0000 (24 13:18 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 1 Oct 2020 14:31:01 +0000 (1 15:31 +0100)
tree8f46547ed2ca16e673512ae429001c76206b7a8c
parent0f15c6e338f040ccea698d83aa51074264194ce5
hw/arm/raspi: Avoid using TypeInfo::class_data pointer

Using class_data pointer to create a MachineClass is not
the recommended way anymore. The correct way is to open-code
the MachineClass::fields in the class_init() method.

We can not use TYPE_RASPI_MACHINE::class_base_init() because
it is called *before* each machine class_init(), therefore the
board_rev field is not populated. We have to manually call
raspi_machine_class_common_init() for each machine.

This partly reverts commit a03bde3674e.

Suggested-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20200924111808.77168-5-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/raspi.c