aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-07-26 16:04:39 +0200
committerAndreas Färber <afaerber@suse.de>2013-07-29 21:06:45 +0200
commit6df7cdee0b0e3667a0e7f811a9682e492f21c738 (patch)
tree6cb833e7461492060c8c37ef0aa14f2767a3b701
parent4f800554f2b324b3cd5ea6a0e69e9e9b409aa65b (diff)
downloadqemu-6df7cdee0b0e3667a0e7f811a9682e492f21c738.zip
qemu-6df7cdee0b0e3667a0e7f811a9682e492f21c738.tar.gz
qemu-6df7cdee0b0e3667a0e7f811a9682e492f21c738.tar.bz2
puv3_dma: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r--hw/dma/puv3_dma.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/dma/puv3_dma.c b/hw/dma/puv3_dma.c
index 36004ae..101bd7f 100644
--- a/hw/dma/puv3_dma.c
+++ b/hw/dma/puv3_dma.c
@@ -18,8 +18,12 @@
#define PUV3_DMA_CH_MASK (0xff)
#define PUV3_DMA_CH(offset) ((offset) >> 8)
-typedef struct {
- SysBusDevice busdev;
+#define TYPE_PUV3_DMA "puv3_dma"
+#define PUV3_DMA(obj) OBJECT_CHECK(PUV3DMAState, (obj), TYPE_PUV3_DMA)
+
+typedef struct PUV3DMAState {
+ SysBusDevice parent_obj;
+
MemoryRegion iomem;
uint32_t reg_CFG[PUV3_DMA_CH_NR];
} PUV3DMAState;
@@ -73,7 +77,7 @@ static const MemoryRegionOps puv3_dma_ops = {
static int puv3_dma_init(SysBusDevice *dev)
{
- PUV3DMAState *s = FROM_SYSBUS(PUV3DMAState, dev);
+ PUV3DMAState *s = PUV3_DMA(dev);
int i;
for (i = 0; i < PUV3_DMA_CH_NR; i++) {
@@ -95,7 +99,7 @@ static void puv3_dma_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo puv3_dma_info = {
- .name = "puv3_dma",
+ .name = TYPE_PUV3_DMA,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(PUV3DMAState),
.class_init = puv3_dma_class_init,