]> git.proxmox.com Git - mirror_qemu.git/blobdiff - hw/usb/desc.c
qdev: Use wrapper for qdev_get_path
[mirror_qemu.git] / hw / usb / desc.c
index e8a3c6af3da68f0e95253fbd5fc8f37797c98f00..0a9d3c9f6055b007c25bd6eda38cec442a1b1d98 100644 (file)
@@ -432,12 +432,13 @@ void usb_desc_create_serial(USBDevice *dev)
     const USBDesc *desc = usb_device_get_usb_desc(dev);
     int index = desc->id.iSerialNumber;
     char serial[64];
+    char *path;
     int dst;
 
     assert(index != 0 && desc->str[index] != NULL);
     dst = snprintf(serial, sizeof(serial), "%s", desc->str[index]);
-    if (hcd && hcd->parent_bus && hcd->parent_bus->info->get_dev_path) {
-        char *path = hcd->parent_bus->info->get_dev_path(hcd);
+    path = qdev_get_dev_path(hcd);
+    if (path) {
         dst += snprintf(serial+dst, sizeof(serial)-dst, "-%s", path);
     }
     dst += snprintf(serial+dst, sizeof(serial)-dst, "-%s", dev->port->path);