提交 112f2ac9 编写于 作者: S Stefan Weil 提交者: Michael Tokarev

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: NStefan Weil <sw@weilnetz.de>
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
上级 f976b09e
...@@ -126,7 +126,7 @@ typedef struct { ...@@ -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) ...@@ -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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册