aboutsummaryrefslogtreecommitdiff
path: root/hw/timer/cadence_ttc.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-07-27 14:28:31 +0200
committerAndreas Färber <afaerber@suse.de>2013-07-29 21:07:01 +0200
commit831aab9b0bb3953161cdbe07a5e475723874321f (patch)
tree793e3bdc06e70d4c024b5618c6443368764e6c0e /hw/timer/cadence_ttc.c
parente2051b42430b014ab6bdcfeabdd869b28282c3a2 (diff)
downloadqemu-831aab9b0bb3953161cdbe07a5e475723874321f.zip
qemu-831aab9b0bb3953161cdbe07a5e475723874321f.tar.gz
qemu-831aab9b0bb3953161cdbe07a5e475723874321f.tar.bz2
cadence_ttc: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/timer/cadence_ttc.c')
-rw-r--r--hw/timer/cadence_ttc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/hw/timer/cadence_ttc.c b/hw/timer/cadence_ttc.c
index a861049..888f9ce 100644
--- a/hw/timer/cadence_ttc.c
+++ b/hw/timer/cadence_ttc.c
@@ -64,8 +64,13 @@ typedef struct {
qemu_irq irq;
} CadenceTimerState;
-typedef struct {
- SysBusDevice busdev;
+#define TYPE_CADENCE_TTC "cadence_ttc"
+#define CADENCE_TTC(obj) \
+ OBJECT_CHECK(CadenceTTCState, (obj), TYPE_CADENCE_TTC)
+
+typedef struct CadenceTTCState {
+ SysBusDevice parent_obj;
+
MemoryRegion iomem;
CadenceTimerState timer[3];
} CadenceTTCState;
@@ -401,7 +406,7 @@ static void cadence_timer_init(uint32_t freq, CadenceTimerState *s)
static int cadence_ttc_init(SysBusDevice *dev)
{
- CadenceTTCState *s = FROM_SYSBUS(CadenceTTCState, dev);
+ CadenceTTCState *s = CADENCE_TTC(dev);
int i;
for (i = 0; i < 3; ++i) {
@@ -476,7 +481,7 @@ static void cadence_ttc_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo cadence_ttc_info = {
- .name = "cadence_ttc",
+ .name = TYPE_CADENCE_TTC,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(CadenceTTCState),
.class_init = cadence_ttc_class_init,