diff mbox

[tegrarcm,v1,5/8] tegrarcm: Better usb debug messages

Message ID 1426639141-12060-7-git-send-email-jimmzhang@nvidia.com
State Deferred
Headers show

Commit Message

jimmzhang March 18, 2015, 12:38 a.m. UTC
From: Allen Martin <amartin@nvidia.com>

Print more explict messages when usb transition failed.

Signed-off-by: Allen Martin <amartin@nvidia.com>
---
 src/nv3p.c | 2 +-
 src/usb.c  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Stephen Warren March 19, 2015, 7:40 p.m. UTC | #1
On 03/17/2015 06:38 PM, Jimmy Zhang wrote:
> From: Allen Martin <amartin@nvidia.com>
>
> Print more explict messages when usb transition failed.

This one applies cleanly even without any of the other patches, so I 
applied it, with a fix for the typo in the commit description.
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/nv3p.c b/src/nv3p.c
index 7f8c72994396..7c7ef1c2f60c 100644
--- a/src/nv3p.c
+++ b/src/nv3p.c
@@ -848,7 +848,7 @@  static int nv3p_read(usb_device_t *usb, uint8_t *buf, int len)
 	if (len > bytesleft) {
 		ret = usb_read(usb, packet, sizeof(packet), &actual_len);
 		if (ret) {
-			dprintf("USB read failed\n");
+			dprintf("USB read failed: %d\n", ret);
 			return ret;
 		}
 
diff --git a/src/usb.c b/src/usb.c
index 8c9c72f38b1a..ed2ff28eef8d 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -231,7 +231,7 @@  int usb_write(usb_device_t *usb, uint8_t *buf, int len)
 		ret = libusb_bulk_transfer(usb->handle, usb->endpt_out, buf,
 					   chunk_size, &actual_chunk, USB_TIMEOUT);
 		if (ret != LIBUSB_SUCCESS) {
-			dprintf("write failure: %d\n", ret);
+			dprintf("libusb write failure: %d: %s\n", ret, libusb_error_name(ret));
 			return EIO;
 		}
 		if (actual_chunk != chunk_size) {
@@ -258,7 +258,7 @@  int usb_read(usb_device_t *usb, uint8_t *buf, int len, int *actual_len)
 		ret = libusb_bulk_transfer(usb->handle, usb->endpt_in, buf,
 					   chunk_size, &actual_chunk, USB_TIMEOUT);
 		if (ret != LIBUSB_SUCCESS) {
-			dprintf("read failure: %d\n", ret);
+			dprintf("libusb read failure: %d: %s\n", ret, libusb_error_name(ret));
 			return EIO;
 		}
 		len -= chunk_size;