puv3_gpio: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
Andreas Färber 2013-07-26 17:37:37 +02:00
parent 692a76d1c4
commit 1ed09e2f43
1 changed files with 8 additions and 4 deletions

View File

@ -14,8 +14,12 @@
#undef DEBUG_PUV3 #undef DEBUG_PUV3
#include "hw/unicore32/puv3.h" #include "hw/unicore32/puv3.h"
typedef struct { #define TYPE_PUV3_GPIO "puv3_gpio"
SysBusDevice busdev; #define PUV3_GPIO(obj) OBJECT_CHECK(PUV3GPIOState, (obj), TYPE_PUV3_GPIO)
typedef struct PUV3GPIOState {
SysBusDevice parent_obj;
MemoryRegion iomem; MemoryRegion iomem;
qemu_irq irq[9]; qemu_irq irq[9];
@ -96,7 +100,7 @@ static const MemoryRegionOps puv3_gpio_ops = {
static int puv3_gpio_init(SysBusDevice *dev) static int puv3_gpio_init(SysBusDevice *dev)
{ {
PUV3GPIOState *s = FROM_SYSBUS(PUV3GPIOState, dev); PUV3GPIOState *s = PUV3_GPIO(dev);
s->reg_GPLR = 0; s->reg_GPLR = 0;
s->reg_GPDR = 0; s->reg_GPDR = 0;
@ -127,7 +131,7 @@ static void puv3_gpio_class_init(ObjectClass *klass, void *data)
} }
static const TypeInfo puv3_gpio_info = { static const TypeInfo puv3_gpio_info = {
.name = "puv3_gpio", .name = TYPE_PUV3_GPIO,
.parent = TYPE_SYS_BUS_DEVICE, .parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(PUV3GPIOState), .instance_size = sizeof(PUV3GPIOState),
.class_init = puv3_gpio_class_init, .class_init = puv3_gpio_class_init,