提交 816d323b 编写于 作者: A Andreas Färber

lm32_sys: QOM cast cleanup

Signed-off-by: NAndreas Färber <afaerber@suse.de>
上级 b6e1df2e
......@@ -44,8 +44,12 @@ enum {
#define MAX_TESTNAME_LEN 16
#define TYPE_LM32_SYS "lm32-sys"
#define LM32_SYS(obj) OBJECT_CHECK(LM32SysState, (obj), TYPE_LM32_SYS)
struct LM32SysState {
SysBusDevice busdev;
SysBusDevice parent_obj;
MemoryRegion iomem;
uint32_t base;
uint32_t regs[R_MAX];
......@@ -104,7 +108,7 @@ static const MemoryRegionOps sys_ops = {
static void sys_reset(DeviceState *d)
{
LM32SysState *s = container_of(d, LM32SysState, busdev.qdev);
LM32SysState *s = LM32_SYS(d);
int i;
for (i = 0; i < R_MAX; i++) {
......@@ -115,7 +119,7 @@ static void sys_reset(DeviceState *d)
static int lm32_sys_init(SysBusDevice *dev)
{
LM32SysState *s = FROM_SYSBUS(typeof(*s), dev);
LM32SysState *s = LM32_SYS(dev);
memory_region_init_io(&s->iomem, OBJECT(dev), &sys_ops , s,
"sys", R_MAX * 4);
......@@ -158,7 +162,7 @@ static void lm32_sys_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo lm32_sys_info = {
.name = "lm32-sys",
.name = TYPE_LM32_SYS,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(LM32SysState),
.class_init = lm32_sys_class_init,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册