diff mbox

[v2,6/9] hw/timer: QOM'ify m48txx_sysbus (pass 2)

Message ID 20170429104937.31341-7-zxq_yx_007@163.com (mailing list archive)
State New, archived
Headers show

Commit Message

zhao xiao qiang April 29, 2017, 10:49 a.m. UTC
assign DeviceClass::vmsd instead of using vmstate_register function

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
---
 hw/timer/m48t59.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Philippe Mathieu-Daudé May 20, 2017, 12:04 a.m. UTC | #1
On 04/29/2017 07:49 AM, xiaoqiang zhao wrote:
> assign DeviceClass::vmsd instead of using vmstate_register function
>
> Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  hw/timer/m48t59.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c
> index eff259ef96..3a9f541c9b 100644
> --- a/hw/timer/m48t59.c
> +++ b/hw/timer/m48t59.c
> @@ -640,8 +640,6 @@ void m48t59_realize_common(M48t59State *s, Error **errp)
>          s->wd_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &watchdog_cb, s);
>      }
>      qemu_get_timedate(&s->alarm, 0);
> -
> -    vmstate_register(NULL, -1, &vmstate_m48t59, s);
>  }
>
>  static void m48t59_init1(Object *obj)
> @@ -702,6 +700,7 @@ static void m48txx_sysbus_class_init(ObjectClass *klass, void *data)
>      dc->realize = m48t59_realize;
>      dc->reset = m48t59_reset_sysbus;
>      dc->props = m48t59_sysbus_properties;
> +    dc->vmsd = &vmstate_m48t59;
>      nc->read = m48txx_sysbus_read;
>      nc->write = m48txx_sysbus_write;
>      nc->toggle_lock = m48txx_sysbus_toggle_lock;
>
diff mbox

Patch

diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c
index eff259ef96..3a9f541c9b 100644
--- a/hw/timer/m48t59.c
+++ b/hw/timer/m48t59.c
@@ -640,8 +640,6 @@  void m48t59_realize_common(M48t59State *s, Error **errp)
         s->wd_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &watchdog_cb, s);
     }
     qemu_get_timedate(&s->alarm, 0);
-
-    vmstate_register(NULL, -1, &vmstate_m48t59, s);
 }
 
 static void m48t59_init1(Object *obj)
@@ -702,6 +700,7 @@  static void m48txx_sysbus_class_init(ObjectClass *klass, void *data)
     dc->realize = m48t59_realize;
     dc->reset = m48t59_reset_sysbus;
     dc->props = m48t59_sysbus_properties;
+    dc->vmsd = &vmstate_m48t59;
     nc->read = m48txx_sysbus_read;
     nc->write = m48txx_sysbus_write;
     nc->toggle_lock = m48txx_sysbus_toggle_lock;