diff mbox

[05/14] qdev: use wrapper for qdev_get_path

Message ID 4FA12A20.1030000@redhat.com
State New
Headers show

Commit Message

Gerd Hoffmann May 2, 2012, 12:35 p.m. UTC
On 05/01/12 20:36, Anthony Liguori wrote:
> Hi Gerd,
> 
> Could you carefully review the USB changes here?  I'm not really sure
> what our contract is with the guest in terms of ABI compatibility.  I
> think it's good but it could use a second set of eyes.

incremental fix attached.

cheers,
  Gerd
From 8823f1f5491639119d267289610fcad6dd1a0872 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Wed, 2 May 2012 14:30:54 +0200
Subject: [PATCH] fixup

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/desc.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/hw/usb/desc.c b/hw/usb/desc.c
index 64352c9..84ea9f2 100644
--- a/hw/usb/desc.c
+++ b/hw/usb/desc.c
@@ -433,13 +433,11 @@  void usb_desc_create_serial(USBDevice *dev)
     int index = desc->id.iSerialNumber;
     char serial[64];
     int dst;
-    char *path = NULL;
+    char *path;
 
     assert(index != 0 && desc->str[index] != NULL);
     dst = snprintf(serial, sizeof(serial), "%s", desc->str[index]);
-    if (hcd->parent_bus && hcd->parent_bus->parent) {
-        path = qdev_get_dev_path(hcd->parent_bus->parent);
-    }
+    path = qdev_get_dev_path(hcd);
     if (path) {
         dst += snprintf(serial+dst, sizeof(serial)-dst, "-%s", path);
     }