summary refs log tree commit diff stats
path: root/hw/rtc/ds1338.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/rtc/ds1338.c')
-rw-r--r--hw/rtc/ds1338.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/rtc/ds1338.c b/hw/rtc/ds1338.c
index 588a9ba9be..10fac3d9c9 100644
--- a/hw/rtc/ds1338.c
+++ b/hw/rtc/ds1338.c
@@ -16,6 +16,7 @@
 #include "migration/vmstate.h"
 #include "qemu/bcd.h"
 #include "qemu/module.h"
+#include "qom/object.h"
 
 /* Size of NVRAM including both the user-accessible area and the
  * secondary register area.
@@ -29,9 +30,11 @@
 #define CTRL_OSF   0x20
 
 #define TYPE_DS1338 "ds1338"
-#define DS1338(obj) OBJECT_CHECK(DS1338State, (obj), TYPE_DS1338)
+typedef struct DS1338State DS1338State;
+DECLARE_INSTANCE_CHECKER(DS1338State, DS1338,
+                         TYPE_DS1338)
 
-typedef struct DS1338State {
+struct DS1338State {
     I2CSlave parent_obj;
 
     int64_t offset;
@@ -39,7 +42,7 @@ typedef struct DS1338State {
     uint8_t nvram[NVRAM_SIZE];
     int32_t ptr;
     bool addr_byte;
-} DS1338State;
+};
 
 static const VMStateDescription vmstate_ds1338 = {
     .name = "ds1338",