diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2020-02-08 17:56:41 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-02-13 14:30:51 +0000 |
commit | 13c4e2c087924d62da006858baee20b1ffb44462 (patch) | |
tree | aec93d0a00e83ad0aa08f003e08c8d1303ee32e2 /hw/arm/raspi.c | |
parent | c318c66c67ba143cd32d709cb2eb20eaf8cb9f8f (diff) |
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>
Diffstat (limited to 'hw/arm/raspi.c')
-rw-r--r-- | hw/arm/raspi.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index fbfcd29732..1628b0dda7 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -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; |