libusb: using error_report instead of fprintf

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gonglei 2014-09-19 14:48:27 +08:00 committed by Gerd Hoffmann
parent 2aa76dc18c
commit 2e6a0dd1ac
1 changed files with 4 additions and 5 deletions

View File

@ -275,7 +275,7 @@ static void usb_host_libusb_error(const char *func, int rc)
} else { } else {
errname = "?"; errname = "?";
} }
fprintf(stderr, "%s: %d [%s]\n", func, rc, errname); error_report("%s: %d [%s]", func, rc, errname);
} }
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
@ -1376,14 +1376,13 @@ static int usb_host_alloc_streams(USBDevice *udev, USBEndpoint **eps,
if (rc < 0) { if (rc < 0) {
usb_host_libusb_error("libusb_alloc_streams", rc); usb_host_libusb_error("libusb_alloc_streams", rc);
} else if (rc != streams) { } else if (rc != streams) {
fprintf(stderr, error_report("libusb_alloc_streams: got less streams "
"libusb_alloc_streams: got less streams then requested %d < %d\n", "then requested %d < %d", rc, streams);
rc, streams);
} }
return (rc == streams) ? 0 : -1; return (rc == streams) ? 0 : -1;
#else #else
fprintf(stderr, "libusb_alloc_streams: error not implemented\n"); error_report("libusb_alloc_streams: error not implemented");
return -1; return -1;
#endif #endif
} }