summaryrefslogtreecommitdiffstats
path: root/hw/dma
diff options
context:
space:
mode:
authorAndreas Färber2013-07-26 16:04:39 +0200
committerAndreas Färber2013-07-29 21:06:45 +0200
commit6df7cdee0b0e3667a0e7f811a9682e492f21c738 (patch)
tree6cb833e7461492060c8c37ef0aa14f2767a3b701 /hw/dma
parentpl080: QOM'ify pl080 and pl081 (diff)
downloadqemu-6df7cdee0b0e3667a0e7f811a9682e492f21c738.tar.gz
qemu-6df7cdee0b0e3667a0e7f811a9682e492f21c738.tar.xz
qemu-6df7cdee0b0e3667a0e7f811a9682e492f21c738.zip
puv3_dma: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/dma')
-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 36004ae48a..101bd7f8af 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,