summaryrefslogtreecommitdiff
path: root/hw/block/onenand.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-06-06 21:25:08 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2013-07-04 17:42:47 +0200
commit2d256e6f652b519c59d0bea926ebb1cb866d4241 (patch)
tree1e7d50647d1989a65e45b2a0298fbcec27c4e2b4 /hw/block/onenand.c
parent64bde0f3e7170cc8a9b60da835b9b3cefd03a7a5 (diff)
downloadqemu-2d256e6f652b519c59d0bea926ebb1cb866d4241.tar.gz
qemu-2d256e6f652b519c59d0bea926ebb1cb866d4241.tar.bz2
qemu-2d256e6f652b519c59d0bea926ebb1cb866d4241.zip
hw/block: pass owner to memory_region_init* functions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/block/onenand.c')
-rw-r--r--hw/block/onenand.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/block/onenand.c b/hw/block/onenand.c
index edbce3c707..2776f64686 100644
--- a/hw/block/onenand.c
+++ b/hw/block/onenand.c
@@ -113,9 +113,10 @@ static void onenand_mem_setup(OneNANDState *s)
/* XXX: We should use IO_MEM_ROMD but we broke it earlier...
* Both 0x0000 ... 0x01ff and 0x8000 ... 0x800f can be used to
* write boot commands. Also take note of the BWPS bit. */
- memory_region_init(&s->container, NULL, "onenand", 0x10000 << s->shift);
+ memory_region_init(&s->container, OBJECT(s), "onenand",
+ 0x10000 << s->shift);
memory_region_add_subregion(&s->container, 0, &s->iomem);
- memory_region_init_alias(&s->mapped_ram, NULL, "onenand-mapped-ram",
+ memory_region_init_alias(&s->mapped_ram, OBJECT(s), "onenand-mapped-ram",
&s->ram, 0x0200 << s->shift,
0xbe00 << s->shift);
memory_region_add_subregion_overlap(&s->container,
@@ -768,7 +769,7 @@ static int onenand_initfn(SysBusDevice *dev)
s->blockwp = g_malloc(s->blocks);
s->density_mask = (s->id.dev & 0x08)
? (1 << (6 + ((s->id.dev >> 4) & 7))) : 0;
- memory_region_init_io(&s->iomem, NULL, &onenand_ops, s, "onenand",
+ memory_region_init_io(&s->iomem, OBJECT(s), &onenand_ops, s, "onenand",
0x10000 << s->shift);
if (!s->bdrv) {
s->image = memset(g_malloc(size + (size >> 5)),
@@ -782,7 +783,8 @@ static int onenand_initfn(SysBusDevice *dev)
}
s->otp = memset(g_malloc((64 + 2) << PAGE_SHIFT),
0xff, (64 + 2) << PAGE_SHIFT);
- memory_region_init_ram(&s->ram, NULL, "onenand.ram", 0xc000 << s->shift);
+ memory_region_init_ram(&s->ram, OBJECT(s), "onenand.ram",
+ 0xc000 << s->shift);
vmstate_register_ram_global(&s->ram);
ram = memory_region_get_ram_ptr(&s->ram);
s->boot[0] = ram + (0x0000 << s->shift);