aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/dev-serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/usb/dev-serial.c')
-rw-r--r--hw/usb/dev-serial.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c
index 7e50e3ba47..1a038a222e 100644
--- a/hw/usb/dev-serial.c
+++ b/hw/usb/dev-serial.c
@@ -19,6 +19,7 @@
#include "desc.h"
#include "chardev/char-serial.h"
#include "chardev/char-fe.h"
+#include "qom/object.h"
//#define DEBUG_Serial
@@ -96,7 +97,7 @@ do { printf("usb-serial: " fmt , ## __VA_ARGS__); } while (0)
#define FTDI_TEMT (1<<6) // Transmitter Empty
#define FTDI_FIFO (1<<7) // Error in FIFO
-typedef struct {
+struct USBSerialState {
USBDevice dev;
USBEndpoint *intr;
uint8_t recv_buf[RECV_BUF];
@@ -108,10 +109,12 @@ typedef struct {
QEMUSerialSetParams params;
int latency; /* ms */
CharBackend cs;
-} USBSerialState;
+};
+typedef struct USBSerialState USBSerialState;
#define TYPE_USB_SERIAL "usb-serial-dev"
-#define USB_SERIAL_DEV(obj) OBJECT_CHECK(USBSerialState, (obj), TYPE_USB_SERIAL)
+DECLARE_INSTANCE_CHECKER(USBSerialState, USB_SERIAL,
+ TYPE_USB_SERIAL)
enum {
STR_MANUFACTURER = 1,
@@ -514,7 +517,7 @@ static void usb_serial_event(void *opaque, QEMUChrEvent event)
static void usb_serial_realize(USBDevice *dev, Error **errp)
{
- USBSerialState *s = USB_SERIAL_DEV(dev);
+ USBSerialState *s = USB_SERIAL(dev);
Error *local_err = NULL;
usb_desc_create_serial(dev);