aboutsummaryrefslogtreecommitdiff
path: root/hw/block
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-07-07 15:42:54 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-07-14 17:59:42 +0100
commitbba3ddf72e75e0a0067aff2af424a5fd27004883 (patch)
tree2fe724ec2eb4932da5c0ebd7eb509f13d20d12d8 /hw/block
parent98a99ce0840991ed28fd4c570ae549c371e89970 (diff)
downloadqemu-bba3ddf72e75e0a0067aff2af424a5fd27004883.zip
qemu-bba3ddf72e75e0a0067aff2af424a5fd27004883.tar.gz
qemu-bba3ddf72e75e0a0067aff2af424a5fd27004883.tar.bz2
hw/block/pflash_cfi01, pflash_cfi02: Use memory_region_init_rom_device()
Since we pass the same DeviceState object to memory_region_init_rom_device_nomigrate() and vmstate_register_ram(), we can switch to using memory_region_init_rom_device() instead. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1499438577-7674-9-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'hw/block')
-rw-r--r--hw/block/pflash_cfi01.c3
-rw-r--r--hw/block/pflash_cfi02.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
index c044b56..1113ab1 100644
--- a/hw/block/pflash_cfi01.c
+++ b/hw/block/pflash_cfi01.c
@@ -743,7 +743,7 @@ static void pflash_cfi01_realize(DeviceState *dev, Error **errp)
return NULL;
#endif
- memory_region_init_rom_device_nomigrate(
+ memory_region_init_rom_device(
&pfl->mem, OBJECT(dev),
&pflash_cfi01_ops,
pfl,
@@ -753,7 +753,6 @@ static void pflash_cfi01_realize(DeviceState *dev, Error **errp)
return;
}
- vmstate_register_ram(&pfl->mem, DEVICE(pfl));
pfl->storage = memory_region_get_ram_ptr(&pfl->mem);
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &pfl->mem);
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
index a08b09b..c81ddd3 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -621,7 +621,7 @@ static void pflash_cfi02_realize(DeviceState *dev, Error **errp)
return NULL;
#endif
- memory_region_init_rom_device_nomigrate(&pfl->orig_mem, OBJECT(pfl), pfl->be ?
+ memory_region_init_rom_device(&pfl->orig_mem, OBJECT(pfl), pfl->be ?
&pflash_cfi02_ops_be : &pflash_cfi02_ops_le,
pfl, pfl->name, chip_len, &local_err);
if (local_err) {
@@ -629,7 +629,6 @@ static void pflash_cfi02_realize(DeviceState *dev, Error **errp)
return;
}
- vmstate_register_ram(&pfl->orig_mem, DEVICE(pfl));
pfl->storage = memory_region_get_ram_ptr(&pfl->orig_mem);
pfl->chip_len = chip_len;