aboutsummaryrefslogtreecommitdiff
path: root/hw/i2c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/i2c')
-rw-r--r--hw/i2c/bitbang_i2c.c3
-rw-r--r--hw/i2c/exynos4210_i2c.c4
-rw-r--r--hw/i2c/mpc_i2c.c4
-rw-r--r--hw/i2c/smbus_eeprom.c4
-rw-r--r--hw/i2c/smbus_ich9.c4
-rw-r--r--hw/i2c/versatile_i2c.c4
6 files changed, 12 insertions, 11 deletions
diff --git a/hw/i2c/bitbang_i2c.c b/hw/i2c/bitbang_i2c.c
index 4ff3c0b4ec..c1b9f298d9 100644
--- a/hw/i2c/bitbang_i2c.c
+++ b/hw/i2c/bitbang_i2c.c
@@ -164,7 +164,8 @@ void bitbang_i2c_init(bitbang_i2c_interface *s, I2CBus *bus)
#define TYPE_GPIO_I2C "gpio_i2c"
typedef struct GPIOI2CState GPIOI2CState;
-#define GPIO_I2C(obj) OBJECT_CHECK(GPIOI2CState, (obj), TYPE_GPIO_I2C)
+DECLARE_INSTANCE_CHECKER(GPIOI2CState, GPIO_I2C,
+ TYPE_GPIO_I2C)
struct GPIOI2CState {
SysBusDevice parent_obj;
diff --git a/hw/i2c/exynos4210_i2c.c b/hw/i2c/exynos4210_i2c.c
index 9d2f780d2a..ff82226e9f 100644
--- a/hw/i2c/exynos4210_i2c.c
+++ b/hw/i2c/exynos4210_i2c.c
@@ -35,8 +35,8 @@
#define TYPE_EXYNOS4_I2C "exynos4210.i2c"
typedef struct Exynos4210I2CState Exynos4210I2CState;
-#define EXYNOS4_I2C(obj) \
- OBJECT_CHECK(Exynos4210I2CState, (obj), TYPE_EXYNOS4_I2C)
+DECLARE_INSTANCE_CHECKER(Exynos4210I2CState, EXYNOS4_I2C,
+ TYPE_EXYNOS4_I2C)
/* Exynos4210 I2C memory map */
#define EXYNOS4_I2C_MEM_SIZE 0x14
diff --git a/hw/i2c/mpc_i2c.c b/hw/i2c/mpc_i2c.c
index 232a277da4..156a25a8e9 100644
--- a/hw/i2c/mpc_i2c.c
+++ b/hw/i2c/mpc_i2c.c
@@ -38,8 +38,8 @@
#define TYPE_MPC_I2C "mpc-i2c"
typedef struct MPCI2CState MPCI2CState;
-#define MPC_I2C(obj) \
- OBJECT_CHECK(MPCI2CState, (obj), TYPE_MPC_I2C)
+DECLARE_INSTANCE_CHECKER(MPCI2CState, MPC_I2C,
+ TYPE_MPC_I2C)
#define MPC_I2C_ADR 0x00
#define MPC_I2C_FDR 0x04
diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c
index 4f98012f1c..c6777844cf 100644
--- a/hw/i2c/smbus_eeprom.c
+++ b/hw/i2c/smbus_eeprom.c
@@ -38,8 +38,8 @@
#define TYPE_SMBUS_EEPROM "smbus-eeprom"
typedef struct SMBusEEPROMDevice SMBusEEPROMDevice;
-#define SMBUS_EEPROM(obj) \
- OBJECT_CHECK(SMBusEEPROMDevice, (obj), TYPE_SMBUS_EEPROM)
+DECLARE_INSTANCE_CHECKER(SMBusEEPROMDevice, SMBUS_EEPROM,
+ TYPE_SMBUS_EEPROM)
#define SMBUS_EEPROM_SIZE 256
diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c
index 44d26fcf39..2d4578511d 100644
--- a/hw/i2c/smbus_ich9.c
+++ b/hw/i2c/smbus_ich9.c
@@ -31,8 +31,8 @@
#include "qom/object.h"
typedef struct ICH9SMBState ICH9SMBState;
-#define ICH9_SMB_DEVICE(obj) \
- OBJECT_CHECK(ICH9SMBState, (obj), TYPE_ICH9_SMB_DEVICE)
+DECLARE_INSTANCE_CHECKER(ICH9SMBState, ICH9_SMB_DEVICE,
+ TYPE_ICH9_SMB_DEVICE)
struct ICH9SMBState {
PCIDevice dev;
diff --git a/hw/i2c/versatile_i2c.c b/hw/i2c/versatile_i2c.c
index 3ab386d671..3a04ba3969 100644
--- a/hw/i2c/versatile_i2c.c
+++ b/hw/i2c/versatile_i2c.c
@@ -30,8 +30,8 @@
#include "qom/object.h"
typedef ArmSbconI2CState VersatileI2CState;
-#define VERSATILE_I2C(obj) \
- OBJECT_CHECK(VersatileI2CState, (obj), TYPE_VERSATILE_I2C)
+DECLARE_INSTANCE_CHECKER(VersatileI2CState, VERSATILE_I2C,
+ TYPE_VERSATILE_I2C)