hw/arm/raspi: Let class_init() directly call raspi_machine_init()

raspi_machine_init() access to board_rev via RaspiMachineClass.
raspi2_init() and raspi3_init() do nothing. Call raspi_machine_init
directly.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-id: 20200208165645.15657-10-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé 2020-02-08 17:56:41 +01:00 committed by Peter Maydell
parent c318c66c67
commit 13c4e2c087
1 changed files with 3 additions and 13 deletions

View File

@ -228,7 +228,7 @@ static void setup_boot(MachineState *machine, int version, size_t ram_size)
arm_load_kernel(ARM_CPU(first_cpu), machine, &binfo);
}
static void raspi_init(MachineState *machine)
static void raspi_machine_init(MachineState *machine)
{
RaspiMachineClass *mc = RASPI_MACHINE_GET_CLASS(machine);
RaspiMachineState *s = RASPI_MACHINE(machine);
@ -280,11 +280,6 @@ static void raspi_init(MachineState *machine)
setup_boot(machine, version, machine->ram_size - vcram_size);
}
static void raspi2_init(MachineState *machine)
{
raspi_init(machine);
}
static void raspi2_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@ -293,7 +288,7 @@ static void raspi2_machine_class_init(ObjectClass *oc, void *data)
rmc->board_rev = board_rev;
mc->desc = "Raspberry Pi 2B";
mc->init = raspi2_init;
mc->init = raspi_machine_init;
mc->block_default_type = IF_SD;
mc->no_parallel = 1;
mc->no_floppy = 1;
@ -306,11 +301,6 @@ static void raspi2_machine_class_init(ObjectClass *oc, void *data)
};
#ifdef TARGET_AARCH64
static void raspi3_init(MachineState *machine)
{
raspi_init(machine);
}
static void raspi3_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@ -319,7 +309,7 @@ static void raspi3_machine_class_init(ObjectClass *oc, void *data)
rmc->board_rev = board_rev;
mc->desc = "Raspberry Pi 3B";
mc->init = raspi3_init;
mc->init = raspi_machine_init;
mc->block_default_type = IF_SD;
mc->no_parallel = 1;
mc->no_floppy = 1;