[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/21] hw/arm/digic4: Inline digic4_board_setup_ram() function
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 06/21] hw/arm/digic4: Inline digic4_board_setup_ram() function |
Date: |
Mon, 21 Oct 2019 00:56:35 +0200 |
Having the RAM creation code in a separate function is not
very helpful. Move this code directly inside the board_init()
function, this will later allow the board to have the QOM
ownership of the RAM.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/arm/digic_boards.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c
index 304e4d1a29..ef3fc2b6a5 100644
--- a/hw/arm/digic_boards.c
+++ b/hw/arm/digic_boards.c
@@ -53,12 +53,6 @@ typedef struct DigicBoard {
const char *rom1_def_filename;
} DigicBoard;
-static void digic4_board_setup_ram(DigicBoardState *s, hwaddr ram_size)
-{
- memory_region_allocate_system_memory(&s->ram, NULL, "ram", ram_size);
- memory_region_add_subregion(get_system_memory(), 0, &s->ram);
-}
-
static void digic4_board_init(DigicBoard *board)
{
Error *err = NULL;
@@ -72,7 +66,8 @@ static void digic4_board_init(DigicBoard *board)
exit(1);
}
- digic4_board_setup_ram(s, board->ram_size);
+ memory_region_allocate_system_memory(&s->ram, NULL, "ram",
board->ram_size);
+ memory_region_add_subregion(get_system_memory(), 0, &s->ram);
if (board->add_rom0) {
board->add_rom0(s, DIGIC4_ROM0_BASE, board->rom0_def_filename);
--
2.21.0
- Re: [PATCH 02/21] hw/arm/mps2: Use the IEC binary prefix definitions, (continued)
- [PATCH 03/21] hw/arm/collie: Create the RAM in the board, Philippe Mathieu-Daudé, 2019/10/20
- [PATCH 04/21] hw/arm/omap2: Create the RAM in the board, Philippe Mathieu-Daudé, 2019/10/20
- [PATCH 05/21] hw/arm/omap1: Create the RAM in the board, Philippe Mathieu-Daudé, 2019/10/20
- [PATCH 06/21] hw/arm/digic4: Inline digic4_board_setup_ram() function,
Philippe Mathieu-Daudé <=
- [PATCH 07/21] hw: Drop QOM ownership on memory_region_allocate_system_memory() calls, Philippe Mathieu-Daudé, 2019/10/20
- [PATCH 08/21] hw/alpha/dp264: Create the RAM in the board, Philippe Mathieu-Daudé, 2019/10/20
- [PATCH 09/21] hw: Let memory_region_allocate_system_memory take MachineState argument, Philippe Mathieu-Daudé, 2019/10/20