aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2013-12-06 19:43:30 +0100
committerMichael Tokarev <mjt@tls.msk.ru>2013-12-23 16:02:19 +0400
commit112f2ac98d8bd4edafc4a4c84d0abcd9ba98a736 (patch)
treeb46e888e449e66fff755556f0567195cc9c19975 /hw
parentf976b09ea249cccc3fd41c98aaf6512908db0bae (diff)
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 <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw')
-rw-r--r--hw/arm/highbank.c7
1 files changed, 3 insertions, 4 deletions
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;
}