]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/sparc: Use memory_region_init_rom() with read-only regions
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 24 Feb 2020 18:51:24 +0000 (19:51 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 17 Mar 2020 14:18:48 +0000 (15:18 +0100)
This commit was produced with the Coccinelle script
scripts/coccinelle/memory-region-housekeeping.cocci.

Reviewed-by: KONRAD Frederic <frederic.konrad@adacore.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
hw/sparc/leon3.c

index 5fa58aa55f5b91a8edf8f32df8ae950165594dfd..8f024dab7b1c3376df4e74a7121f24686a48e5fe 100644 (file)
@@ -255,8 +255,7 @@ static void leon3_generic_hw_init(MachineState *machine)
 
     /* Allocate BIOS */
     prom_size = 8 * MiB;
-    memory_region_init_ram(prom, NULL, "Leon3.bios", prom_size, &error_fatal);
-    memory_region_set_readonly(prom, true);
+    memory_region_init_rom(prom, NULL, "Leon3.bios", prom_size, &error_fatal);
     memory_region_add_subregion(address_space_mem, LEON3_PROM_OFFSET, prom);
 
     /* Load boot prom */