From 112f2ac98d8bd4edafc4a4c84d0abcd9ba98a736 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Fri, 6 Dec 2013 19:43:30 +0100 Subject: hw/arm/highbank: Simplify code (memory region in device state) The memory region can be included by value instead of by reference in the device state. Signed-off-by: Stefan Weil Reviewed-by: Peter Maydell Reviewed-by: Peter Crosthwaite Signed-off-by: Michael Tokarev --- hw/arm/highbank.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'hw') diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index c75b425c01..d76a1d1f78 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -126,7 +126,7 @@ typedef struct { SysBusDevice parent_obj; /*< public >*/ - MemoryRegion *iomem; + MemoryRegion iomem; uint32_t regs[NUM_REGS]; } HighbankRegsState; @@ -155,10 +155,9 @@ static int highbank_regs_init(SysBusDevice *dev) { HighbankRegsState *s = HIGHBANK_REGISTERS(dev); - s->iomem = g_new(MemoryRegion, 1); - memory_region_init_io(s->iomem, OBJECT(s), &hb_mem_ops, s->regs, + memory_region_init_io(&s->iomem, OBJECT(s), &hb_mem_ops, s->regs, "highbank_regs", 0x1000); - sysbus_init_mmio(dev, s->iomem); + sysbus_init_mmio(dev, &s->iomem); return 0; } -- cgit v1.2.3