diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-15 14:53:10 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:47 -0600 |
commit | 62aed76583fe8bf8e6ba5955b2ecfa3619ea3540 (patch) | |
tree | a536e59eab00a94fccfbb8b3ad8b32e902e77ea2 /hw/usb-wacom.c | |
parent | 8f04ee0882aec9fe91fb70f767edf5dacff59835 (diff) | |
download | qemu-62aed76583fe8bf8e6ba5955b2ecfa3619ea3540.tar.gz qemu-62aed76583fe8bf8e6ba5955b2ecfa3619ea3540.tar.bz2 qemu-62aed76583fe8bf8e6ba5955b2ecfa3619ea3540.zip |
usb: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/usb-wacom.c')
-rw-r--r-- | hw/usb-wacom.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/hw/usb-wacom.c b/hw/usb-wacom.c index 61d5b184df..9b20a3154c 100644 --- a/hw/usb-wacom.c +++ b/hw/usb-wacom.c @@ -349,24 +349,30 @@ static const VMStateDescription vmstate_usb_wacom = { .unmigratable = 1, }; -static struct USBDeviceInfo wacom_info = { - .product_desc = "QEMU PenPartner Tablet", - .qdev.name = "usb-wacom-tablet", - .qdev.desc = "QEMU PenPartner Tablet", - .usbdevice_name = "wacom-tablet", - .usb_desc = &desc_wacom, - .qdev.size = sizeof(USBWacomState), - .qdev.vmsd = &vmstate_usb_wacom, - .init = usb_wacom_initfn, - .handle_packet = usb_generic_handle_packet, - .handle_reset = usb_wacom_handle_reset, - .handle_control = usb_wacom_handle_control, - .handle_data = usb_wacom_handle_data, - .handle_destroy = usb_wacom_handle_destroy, +static void usb_wacom_class_init(ObjectClass *class, void *data) +{ + USBDeviceClass *uc = USB_DEVICE_CLASS(class); + + uc->product_desc = "QEMU PenPartner Tablet"; + uc->usb_desc = &desc_wacom; + uc->init = usb_wacom_initfn; + uc->handle_packet = usb_generic_handle_packet; + uc->handle_reset = usb_wacom_handle_reset; + uc->handle_control = usb_wacom_handle_control; + uc->handle_data = usb_wacom_handle_data; + uc->handle_destroy = usb_wacom_handle_destroy; +} + +static struct DeviceInfo wacom_info = { + .name = "usb-wacom-tablet", + .desc = "QEMU PenPartner Tablet", + .size = sizeof(USBWacomState), + .vmsd = &vmstate_usb_wacom, + .class_init= usb_wacom_class_init, }; static void usb_wacom_register_devices(void) { - usb_qdev_register(&wacom_info); + usb_qdev_register(&wacom_info, "wacom-tablet", NULL); } device_init(usb_wacom_register_devices) |