aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2015-05-06 20:55:34 +0800
committerGerd Hoffmann <kraxel@redhat.com>2015-05-08 13:01:07 +0200
commit924e567e1e6641f4af7e927f9c420cc7b4464073 (patch)
tree316dfecc08a5c227b48d673ea6ea93ead382d2f8 /hw
parent0b06d099b0ab9b055414508ca55133b200d675f8 (diff)
usb: usb-wacom-tablet QOMify
Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb/dev-wacom.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/usb/dev-wacom.c b/hw/usb/dev-wacom.c
index 844eafadf7..c2450e7297 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)