aboutsummaryrefslogtreecommitdiff
path: root/hw/char
diff options
context:
space:
mode:
Diffstat (limited to 'hw/char')
-rw-r--r--hw/char/debugcon.c4
-rw-r--r--hw/char/etraxfs_ser.c4
-rw-r--r--hw/char/exynos4210_uart.c4
-rw-r--r--hw/char/grlib_apbuart.c4
-rw-r--r--hw/char/ipoctal232.c4
-rw-r--r--hw/char/lm32_juart.c3
-rw-r--r--hw/char/lm32_uart.c3
-rw-r--r--hw/char/mcf_uart.c3
-rw-r--r--hw/char/milkymist-uart.c4
-rw-r--r--hw/char/parallel.c4
-rw-r--r--hw/char/sclpconsole-lm.c4
-rw-r--r--hw/char/sclpconsole.c4
-rw-r--r--hw/char/serial-isa.c3
-rw-r--r--hw/char/serial-pci.c3
-rw-r--r--hw/char/spapr_vty.c4
-rw-r--r--hw/char/terminal3270.c4
-rw-r--r--hw/char/virtio-console.c4
-rw-r--r--hw/char/xilinx_uartlite.c4
18 files changed, 36 insertions, 31 deletions
diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c
index 219e88efee..daaaca0f39 100644
--- a/hw/char/debugcon.c
+++ b/hw/char/debugcon.c
@@ -34,8 +34,8 @@
#define TYPE_ISA_DEBUGCON_DEVICE "isa-debugcon"
typedef struct ISADebugconState ISADebugconState;
-#define ISA_DEBUGCON_DEVICE(obj) \
- OBJECT_CHECK(ISADebugconState, (obj), TYPE_ISA_DEBUGCON_DEVICE)
+DECLARE_INSTANCE_CHECKER(ISADebugconState, ISA_DEBUGCON_DEVICE,
+ TYPE_ISA_DEBUGCON_DEVICE)
//#define DEBUG_DEBUGCON
diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c
index 9ca9f21c4d..d9fba2ae6c 100644
--- a/hw/char/etraxfs_ser.c
+++ b/hw/char/etraxfs_ser.c
@@ -51,8 +51,8 @@
#define TYPE_ETRAX_FS_SERIAL "etraxfs,serial"
typedef struct ETRAXSerial ETRAXSerial;
-#define ETRAX_SERIAL(obj) \
- OBJECT_CHECK(ETRAXSerial, (obj), TYPE_ETRAX_FS_SERIAL)
+DECLARE_INSTANCE_CHECKER(ETRAXSerial, ETRAX_SERIAL,
+ TYPE_ETRAX_FS_SERIAL)
struct ETRAXSerial {
SysBusDevice parent_obj;
diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c
index e3a21dfdb8..b8ea34edbd 100644
--- a/hw/char/exynos4210_uart.c
+++ b/hw/char/exynos4210_uart.c
@@ -140,8 +140,8 @@ typedef struct {
#define TYPE_EXYNOS4210_UART "exynos4210.uart"
typedef struct Exynos4210UartState Exynos4210UartState;
-#define EXYNOS4210_UART(obj) \
- OBJECT_CHECK(Exynos4210UartState, (obj), TYPE_EXYNOS4210_UART)
+DECLARE_INSTANCE_CHECKER(Exynos4210UartState, EXYNOS4210_UART,
+ TYPE_EXYNOS4210_UART)
struct Exynos4210UartState {
SysBusDevice parent_obj;
diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c
index f48ad21c7c..6fd88d83ad 100644
--- a/hw/char/grlib_apbuart.c
+++ b/hw/char/grlib_apbuart.c
@@ -74,8 +74,8 @@
#define FIFO_LENGTH 1024
typedef struct UART UART;
-#define GRLIB_APB_UART(obj) \
- OBJECT_CHECK(UART, (obj), TYPE_GRLIB_APB_UART)
+DECLARE_INSTANCE_CHECKER(UART, GRLIB_APB_UART,
+ TYPE_GRLIB_APB_UART)
struct UART {
SysBusDevice parent_obj;
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c
index c7ea7f8da9..2c987df8ad 100644
--- a/hw/char/ipoctal232.c
+++ b/hw/char/ipoctal232.c
@@ -123,8 +123,8 @@ struct IPOctalState {
#define TYPE_IPOCTAL "ipoctal232"
-#define IPOCTAL(obj) \
- OBJECT_CHECK(IPOctalState, (obj), TYPE_IPOCTAL)
+DECLARE_INSTANCE_CHECKER(IPOctalState, IPOCTAL,
+ TYPE_IPOCTAL)
static const VMStateDescription vmstate_scc2698_channel = {
.name = "scc2698_channel",
diff --git a/hw/char/lm32_juart.c b/hw/char/lm32_juart.c
index e7af76ad1a..5723f2e189 100644
--- a/hw/char/lm32_juart.c
+++ b/hw/char/lm32_juart.c
@@ -43,7 +43,8 @@ enum {
};
typedef struct LM32JuartState LM32JuartState;
-#define LM32_JUART(obj) OBJECT_CHECK(LM32JuartState, (obj), TYPE_LM32_JUART)
+DECLARE_INSTANCE_CHECKER(LM32JuartState, LM32_JUART,
+ TYPE_LM32_JUART)
struct LM32JuartState {
SysBusDevice parent_obj;
diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c
index 8aff78592b..624bc83c5f 100644
--- a/hw/char/lm32_uart.c
+++ b/hw/char/lm32_uart.c
@@ -96,7 +96,8 @@ enum {
#define TYPE_LM32_UART "lm32-uart"
typedef struct LM32UartState LM32UartState;
-#define LM32_UART(obj) OBJECT_CHECK(LM32UartState, (obj), TYPE_LM32_UART)
+DECLARE_INSTANCE_CHECKER(LM32UartState, LM32_UART,
+ TYPE_LM32_UART)
struct LM32UartState {
SysBusDevice parent_obj;
diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c
index d6745da72a..f6baa3ce77 100644
--- a/hw/char/mcf_uart.c
+++ b/hw/char/mcf_uart.c
@@ -38,7 +38,8 @@ struct mcf_uart_state {
typedef struct mcf_uart_state mcf_uart_state;
#define TYPE_MCF_UART "mcf-uart"
-#define MCF_UART(obj) OBJECT_CHECK(mcf_uart_state, (obj), TYPE_MCF_UART)
+DECLARE_INSTANCE_CHECKER(mcf_uart_state, MCF_UART,
+ TYPE_MCF_UART)
/* UART Status Register bits. */
#define MCF_UART_RxRDY 0x01
diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c
index 300a9150cf..41204a0e28 100644
--- a/hw/char/milkymist-uart.c
+++ b/hw/char/milkymist-uart.c
@@ -59,8 +59,8 @@ enum {
#define TYPE_MILKYMIST_UART "milkymist-uart"
typedef struct MilkymistUartState MilkymistUartState;
-#define MILKYMIST_UART(obj) \
- OBJECT_CHECK(MilkymistUartState, (obj), TYPE_MILKYMIST_UART)
+DECLARE_INSTANCE_CHECKER(MilkymistUartState, MILKYMIST_UART,
+ TYPE_MILKYMIST_UART)
struct MilkymistUartState {
SysBusDevice parent_obj;
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 73ac5ee9e3..ddb14f3197 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -94,8 +94,8 @@ typedef struct ParallelState {
#define TYPE_ISA_PARALLEL "isa-parallel"
typedef struct ISAParallelState ISAParallelState;
-#define ISA_PARALLEL(obj) \
- OBJECT_CHECK(ISAParallelState, (obj), TYPE_ISA_PARALLEL)
+DECLARE_INSTANCE_CHECKER(ISAParallelState, ISA_PARALLEL,
+ TYPE_ISA_PARALLEL)
struct ISAParallelState {
ISADevice parent_obj;
diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c
index 0b77af68a4..81f6d0ed4f 100644
--- a/hw/char/sclpconsole-lm.c
+++ b/hw/char/sclpconsole-lm.c
@@ -49,8 +49,8 @@ struct SCLPConsoleLM {
typedef struct SCLPConsoleLM SCLPConsoleLM;
#define TYPE_SCLPLM_CONSOLE "sclplmconsole"
-#define SCLPLM_CONSOLE(obj) \
- OBJECT_CHECK(SCLPConsoleLM, (obj), TYPE_SCLPLM_CONSOLE)
+DECLARE_INSTANCE_CHECKER(SCLPConsoleLM, SCLPLM_CONSOLE,
+ TYPE_SCLPLM_CONSOLE)
/*
* Character layer call-back functions
diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c
index 3919368570..aa72ab40b9 100644
--- a/hw/char/sclpconsole.c
+++ b/hw/char/sclpconsole.c
@@ -45,8 +45,8 @@ struct SCLPConsole {
typedef struct SCLPConsole SCLPConsole;
#define TYPE_SCLP_CONSOLE "sclpconsole"
-#define SCLP_CONSOLE(obj) \
- OBJECT_CHECK(SCLPConsole, (obj), TYPE_SCLP_CONSOLE)
+DECLARE_INSTANCE_CHECKER(SCLPConsole, SCLP_CONSOLE,
+ TYPE_SCLP_CONSOLE)
/* character layer call-back functions */
diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c
index 3d1c9a2d75..d4aad81a85 100644
--- a/hw/char/serial-isa.c
+++ b/hw/char/serial-isa.c
@@ -35,7 +35,8 @@
#include "qom/object.h"
typedef struct ISASerialState ISASerialState;
-#define ISA_SERIAL(obj) OBJECT_CHECK(ISASerialState, (obj), TYPE_ISA_SERIAL)
+DECLARE_INSTANCE_CHECKER(ISASerialState, ISA_SERIAL,
+ TYPE_ISA_SERIAL)
struct ISASerialState {
ISADevice parent_obj;
diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
index 649f08c20e..f68948154e 100644
--- a/hw/char/serial-pci.c
+++ b/hw/char/serial-pci.c
@@ -43,7 +43,8 @@ struct PCISerialState {
typedef struct PCISerialState PCISerialState;
#define TYPE_PCI_SERIAL "pci-serial"
-#define PCI_SERIAL(s) OBJECT_CHECK(PCISerialState, (s), TYPE_PCI_SERIAL)
+DECLARE_INSTANCE_CHECKER(PCISerialState, PCI_SERIAL,
+ TYPE_PCI_SERIAL)
static void serial_pci_realize(PCIDevice *dev, Error **errp)
{
diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c
index 9944933c16..dd6dd2d8c3 100644
--- a/hw/char/spapr_vty.c
+++ b/hw/char/spapr_vty.c
@@ -21,8 +21,8 @@ struct SpaprVioVty {
typedef struct SpaprVioVty SpaprVioVty;
#define TYPE_VIO_SPAPR_VTY_DEVICE "spapr-vty"
-#define VIO_SPAPR_VTY_DEVICE(obj) \
- OBJECT_CHECK(SpaprVioVty, (obj), TYPE_VIO_SPAPR_VTY_DEVICE)
+DECLARE_INSTANCE_CHECKER(SpaprVioVty, VIO_SPAPR_VTY_DEVICE,
+ TYPE_VIO_SPAPR_VTY_DEVICE)
static int vty_can_receive(void *opaque)
{
diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c
index 4efd6a9433..d77981bb6d 100644
--- a/hw/char/terminal3270.c
+++ b/hw/char/terminal3270.c
@@ -39,8 +39,8 @@ struct Terminal3270 {
typedef struct Terminal3270 Terminal3270;
#define TYPE_TERMINAL_3270 "x-terminal3270"
-#define TERMINAL_3270(obj) \
- OBJECT_CHECK(Terminal3270, (obj), TYPE_TERMINAL_3270)
+DECLARE_INSTANCE_CHECKER(Terminal3270, TERMINAL_3270,
+ TYPE_TERMINAL_3270)
static int terminal_can_read(void *opaque)
{
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index 31144c68b6..bc752cf90f 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -23,8 +23,8 @@
#define TYPE_VIRTIO_CONSOLE_SERIAL_PORT "virtserialport"
typedef struct VirtConsole VirtConsole;
-#define VIRTIO_CONSOLE(obj) \
- OBJECT_CHECK(VirtConsole, (obj), TYPE_VIRTIO_CONSOLE_SERIAL_PORT)
+DECLARE_INSTANCE_CHECKER(VirtConsole, VIRTIO_CONSOLE,
+ TYPE_VIRTIO_CONSOLE_SERIAL_PORT)
struct VirtConsole {
VirtIOSerialPort parent_obj;
diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c
index e7ab97d58d..8e9f9cd9ec 100644
--- a/hw/char/xilinx_uartlite.c
+++ b/hw/char/xilinx_uartlite.c
@@ -54,8 +54,8 @@
#define TYPE_XILINX_UARTLITE "xlnx.xps-uartlite"
typedef struct XilinxUARTLite XilinxUARTLite;
-#define XILINX_UARTLITE(obj) \
- OBJECT_CHECK(XilinxUARTLite, (obj), TYPE_XILINX_UARTLITE)
+DECLARE_INSTANCE_CHECKER(XilinxUARTLite, XILINX_UARTLITE,
+ TYPE_XILINX_UARTLITE)
struct XilinxUARTLite {
SysBusDevice parent_obj;