puv3_pm: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
Andreas Färber 2013-07-26 23:16:03 +02:00
parent 5c0e12f5a6
commit af89a44493

View File

@ -14,8 +14,12 @@
#undef DEBUG_PUV3
#include "hw/unicore32/puv3.h"
typedef struct {
SysBusDevice busdev;
#define TYPE_PUV3_PM "puv3_pm"
#define PUV3_PM(obj) OBJECT_CHECK(PUV3PMState, (obj), TYPE_PUV3_PM)
typedef struct PUV3PMState {
SysBusDevice parent_obj;
MemoryRegion iomem;
uint32_t reg_PMCR;
@ -116,7 +120,7 @@ static const MemoryRegionOps puv3_pm_ops = {
static int puv3_pm_init(SysBusDevice *dev)
{
PUV3PMState *s = FROM_SYSBUS(PUV3PMState, dev);
PUV3PMState *s = PUV3_PM(dev);
s->reg_PCGR = 0x0;
@ -135,7 +139,7 @@ static void puv3_pm_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo puv3_pm_info = {
.name = "puv3_pm",
.name = TYPE_PUV3_PM,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(PUV3PMState),
.class_init = puv3_pm_class_init,