summary refs log tree commit diff stats
path: root/include/hw/ide/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hw/ide/internal.h')
-rw-r--r--include/hw/ide/internal.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
index 1a7869e85d..eb9eb4e0ae 100644
--- a/include/hw/ide/internal.h
+++ b/include/hw/ide/internal.h
@@ -17,6 +17,7 @@
 
 /* debug IDE devices */
 #define USE_DMA_CDROM
+#include "qom/object.h"
 
 typedef struct IDEBus IDEBus;
 typedef struct IDEDevice IDEDevice;
@@ -25,7 +26,8 @@ typedef struct IDEDMA IDEDMA;
 typedef struct IDEDMAOps IDEDMAOps;
 
 #define TYPE_IDE_BUS "IDE"
-#define IDE_BUS(obj) OBJECT_CHECK(IDEBus, (obj), TYPE_IDE_BUS)
+DECLARE_INSTANCE_CHECKER(IDEBus, IDE_BUS,
+                         TYPE_IDE_BUS)
 
 #define MAX_IDE_DEVS 2
 
@@ -486,17 +488,14 @@ struct IDEBus {
 };
 
 #define TYPE_IDE_DEVICE "ide-device"
-#define IDE_DEVICE(obj) \
-     OBJECT_CHECK(IDEDevice, (obj), TYPE_IDE_DEVICE)
-#define IDE_DEVICE_CLASS(klass) \
-     OBJECT_CLASS_CHECK(IDEDeviceClass, (klass), TYPE_IDE_DEVICE)
-#define IDE_DEVICE_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(IDEDeviceClass, (obj), TYPE_IDE_DEVICE)
-
-typedef struct IDEDeviceClass {
+typedef struct IDEDeviceClass IDEDeviceClass;
+DECLARE_OBJ_CHECKERS(IDEDevice, IDEDeviceClass,
+                     IDE_DEVICE, TYPE_IDE_DEVICE)
+
+struct IDEDeviceClass {
     DeviceClass parent_class;
     void (*realize)(IDEDevice *dev, Error **errp);
-} IDEDeviceClass;
+};
 
 struct IDEDevice {
     DeviceState qdev;