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>
This commit is contained in:
Stefan Weil 2013-12-06 19:43:30 +01:00 committed by Michael Tokarev
parent f976b09ea2
commit 112f2ac98d

View File

@ -126,7 +126,7 @@ typedef struct {
SysBusDevice parent_obj; SysBusDevice parent_obj;
/*< public >*/ /*< public >*/
MemoryRegion *iomem; MemoryRegion iomem;
uint32_t regs[NUM_REGS]; uint32_t regs[NUM_REGS];
} HighbankRegsState; } HighbankRegsState;
@ -155,10 +155,9 @@ static int highbank_regs_init(SysBusDevice *dev)
{ {
HighbankRegsState *s = HIGHBANK_REGISTERS(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); "highbank_regs", 0x1000);
sysbus_init_mmio(dev, s->iomem); sysbus_init_mmio(dev, &s->iomem);
return 0; return 0;
} }