diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-11-17 12:47:16 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-12-04 14:41:54 +0100 |
commit | 386ab487ebc25d780ddfc4a9aea0b21c4a9aaa94 (patch) | |
tree | 2de6f40c64d8111f94cecf570824232933023850 /hw/usb/bus.c | |
parent | be41efde3ca0372dbf7543e09ff473b4eec25057 (diff) |
usb: Allow overriding of usb_desc at the device level
This allows devices to present a different set of descriptors based on
device properties.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/bus.c')
-rw-r--r-- | hw/usb/bus.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c index 55d0edd5c3..8264c240ee 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -166,6 +166,9 @@ const char *usb_device_get_product_desc(USBDevice *dev) const USBDesc *usb_device_get_usb_desc(USBDevice *dev) { USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); + if (dev->usb_desc) { + return dev->usb_desc; + } return klass->usb_desc; } |