aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/tusb6010.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/usb/tusb6010.c')
-rw-r--r--hw/usb/tusb6010.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c
index 27eb28d3e4..dd20996d13 100644
--- a/hw/usb/tusb6010.c
+++ b/hw/usb/tusb6010.c
@@ -28,11 +28,14 @@
#include "hw/hw.h"
#include "hw/irq.h"
#include "hw/sysbus.h"
+#include "qom/object.h"
#define TYPE_TUSB6010 "tusb6010"
-#define TUSB(obj) OBJECT_CHECK(TUSBState, (obj), TYPE_TUSB6010)
+typedef struct TUSBState TUSBState;
+DECLARE_INSTANCE_CHECKER(TUSBState, TUSB6010,
+ TYPE_TUSB6010)
-typedef struct TUSBState {
+struct TUSBState {
SysBusDevice parent_obj;
MemoryRegion iomem[2];
@@ -68,7 +71,7 @@ typedef struct TUSBState {
uint32_t pullup[2];
uint32_t control_config;
uint32_t otg_timer_val;
-} TUSBState;
+};
#define TUSB_DEVCLOCK 60000000 /* 60 MHz */
@@ -776,7 +779,7 @@ static void tusb6010_irq(void *opaque, int source, int level)
static void tusb6010_reset(DeviceState *dev)
{
- TUSBState *s = TUSB(dev);
+ TUSBState *s = TUSB6010(dev);
int i;
s->test_reset = TUSB_PROD_TEST_RESET_VAL;
@@ -812,7 +815,7 @@ static void tusb6010_reset(DeviceState *dev)
static void tusb6010_realize(DeviceState *dev, Error **errp)
{
- TUSBState *s = TUSB(dev);
+ TUSBState *s = TUSB6010(dev);
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
s->otg_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, tusb_otg_tick, s);