aboutsummaryrefslogtreecommitdiff
path: root/hw/timer/exynos4210_pwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/timer/exynos4210_pwm.c')
-rw-r--r--hw/timer/exynos4210_pwm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/timer/exynos4210_pwm.c b/hw/timer/exynos4210_pwm.c
index de181428b4..220088120e 100644
--- a/hw/timer/exynos4210_pwm.c
+++ b/hw/timer/exynos4210_pwm.c
@@ -410,6 +410,16 @@ static void exynos4210_pwm_init(Object *obj)
sysbus_init_mmio(dev, &s->iomem);
}
+static void exynos4210_pwm_finalize(Object *obj)
+{
+ Exynos4210PWMState *s = EXYNOS4210_PWM(obj);
+ int i;
+
+ for (i = 0; i < EXYNOS4210_PWM_TIMERS_NUM; i++) {
+ ptimer_free(s->timer[i].ptimer);
+ }
+}
+
static void exynos4210_pwm_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -423,6 +433,7 @@ static const TypeInfo exynos4210_pwm_info = {
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(Exynos4210PWMState),
.instance_init = exynos4210_pwm_init,
+ .instance_finalize = exynos4210_pwm_finalize,
.class_init = exynos4210_pwm_class_init,
};