[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 049/197] usb-hid: simply class initialization a b
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH v3 049/197] usb-hid: simply class initialization a bit |
Date: |
Mon, 12 Dec 2011 14:18:45 -0600 |
---
hw/usb-hid.c | 27 +++++++++++++--------------
1 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/hw/usb-hid.c b/hw/usb-hid.c
index 2538b9c..3a587c4 100644
--- a/hw/usb-hid.c
+++ b/hw/usb-hid.c
@@ -560,13 +560,10 @@ static const VMStateDescription vmstate_usb_kbd = {
}
};
-static void usb_tablet_class_initfn(ObjectClass *klass, void *data)
+static void usb_hid_class_initfn(ObjectClass *klass, void *data)
{
USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
- uc->init = usb_tablet_initfn;
- uc->product_desc = "QEMU USB Tablet";
- uc->usb_desc = &desc_tablet;
uc->handle_packet = usb_generic_handle_packet;
uc->handle_reset = usb_hid_handle_reset;
uc->handle_control = usb_hid_handle_control;
@@ -574,6 +571,16 @@ static void usb_tablet_class_initfn(ObjectClass *klass,
void *data)
uc->handle_destroy = usb_hid_handle_destroy;
}
+static void usb_tablet_class_initfn(ObjectClass *klass, void *data)
+{
+ USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
+
+ usb_hid_class_initfn(klass, data);
+ uc->init = usb_tablet_initfn;
+ uc->product_desc = "QEMU USB Tablet";
+ uc->usb_desc = &desc_tablet;
+}
+
static struct DeviceInfo usb_tablet_info = {
.name = "usb-tablet",
.size = sizeof(USBHIDState),
@@ -585,14 +592,10 @@ static void usb_mouse_class_initfn(ObjectClass *klass,
void *data)
{
USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
+ usb_hid_class_initfn(klass, data);
uc->init = usb_mouse_initfn;
uc->product_desc = "QEMU USB Mouse";
uc->usb_desc = &desc_mouse;
- uc->handle_packet = usb_generic_handle_packet;
- uc->handle_reset = usb_hid_handle_reset;
- uc->handle_control = usb_hid_handle_control;
- uc->handle_data = usb_hid_handle_data;
- uc->handle_destroy = usb_hid_handle_destroy;
}
static struct DeviceInfo usb_mouse_info = {
@@ -606,14 +609,10 @@ static void usb_keyboard_class_initfn(ObjectClass *klass,
void *data)
{
USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
+ usb_hid_class_initfn(klass, data);
uc->init = usb_keyboard_initfn;
uc->product_desc = "QEMU USB Keyboard";
uc->usb_desc = &desc_keyboard;
- uc->handle_packet = usb_generic_handle_packet;
- uc->handle_reset = usb_hid_handle_reset;
- uc->handle_control = usb_hid_handle_control;
- uc->handle_data = usb_hid_handle_data;
- uc->handle_destroy = usb_hid_handle_destroy;
}
static struct DeviceInfo usb_keyboard_info = {
--
1.7.4.1
- [Qemu-devel] [PATCH v3 033/197] a little better approach to this, (continued)
- [Qemu-devel] [PATCH v3 033/197] a little better approach to this, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 034/197] qdev: add isa-device as a subclass of device, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 035/197] isa: more isa stuff, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 036/197] qom: make pcidevice part of the hierarchy, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 039/197] virtio-serial-port, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 040/197] get rid of more DO_UPCAST, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 042/197] isa: move methods from isadeviceinfo to isadeviceclass, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 045/197] usb: get rid of info pointer, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 047/197] usb: use a factory instead of doing silly things for legacy, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 046/197] usb: promote all of the methods for USBDevice to class methods, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 049/197] usb-hid: simply class initialization a bit,
Anthony Liguori <=
- [Qemu-devel] [PATCH v3 051/197] drop info link in SCSIDeviceInfo, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 048/197] usb: kill USBDeviceInfo, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 052/197] move methods out of SCSIDeviceInfo into SCSIDeviceClass, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 054/197] get rid of CCIDCardInfo, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 056/197] add I2CSlave to the type hierarchy, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 055/197] rename i2c_slave -> I2CSlave, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 058/197] fixup type registration, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 059/197] kill off SMBusDeviceInfo, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 060/197] add guards, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 061/197] killall I2CSlaveInfo, Anthony Liguori, 2011/12/12