From 924e567e1e6641f4af7e927f9c420cc7b4464073 Mon Sep 17 00:00:00 2001 From: Gonglei Date: Wed, 6 May 2015 20:55:34 +0800 Subject: usb: usb-wacom-tablet QOMify Signed-off-by: Gonglei Signed-off-by: Gerd Hoffmann --- hw/usb/dev-wacom.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'hw/usb') diff --git a/hw/usb/dev-wacom.c b/hw/usb/dev-wacom.c index 844eafa..c2450e7 100644 --- a/hw/usb/dev-wacom.c +++ b/hw/usb/dev-wacom.c @@ -56,6 +56,9 @@ typedef struct USBWacomState { int changed; } USBWacomState; +#define TYPE_USB_WACOM "usb-wacom-tablet" +#define USB_WACOM(obj) OBJECT_CHECK(USBWacomState, (obj), TYPE_USB_WACOM) + enum { STR_MANUFACTURER = 1, STR_PRODUCT, @@ -337,7 +340,7 @@ static void usb_wacom_handle_destroy(USBDevice *dev) static void usb_wacom_realize(USBDevice *dev, Error **errp) { - USBWacomState *s = DO_UPCAST(USBWacomState, dev, dev); + USBWacomState *s = USB_WACOM(dev); usb_desc_create_serial(dev); usb_desc_init(dev); s->intr = usb_ep_get(dev, USB_TOKEN_IN, 1); @@ -367,7 +370,7 @@ static void usb_wacom_class_init(ObjectClass *klass, void *data) } static const TypeInfo wacom_info = { - .name = "usb-wacom-tablet", + .name = TYPE_USB_WACOM, .parent = TYPE_USB_DEVICE, .instance_size = sizeof(USBWacomState), .class_init = usb_wacom_class_init, @@ -376,7 +379,7 @@ static const TypeInfo wacom_info = { static void usb_wacom_register_types(void) { type_register_static(&wacom_info); - usb_legacy_register("usb-wacom-tablet", "wacom-tablet", NULL); + usb_legacy_register(TYPE_USB_WACOM, "wacom-tablet", NULL); } type_init(usb_wacom_register_types) -- cgit v1.1