From e4f538446b1a000c0c07a493c03c19c84670b0c5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 30 Apr 2015 13:03:28 -0600 Subject: [PATCH] USB hub: Minor fix to reduce the amount of debug garbage on console in certain configurations --- drivers/usbhost/usbhost_findclass.c | 2 +- drivers/usbhost/usbhost_hub.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/usbhost/usbhost_findclass.c b/drivers/usbhost/usbhost_findclass.c index 46fbfc76fd..78d974128c 100644 --- a/drivers/usbhost/usbhost_findclass.c +++ b/drivers/usbhost/usbhost_findclass.c @@ -160,7 +160,7 @@ const struct usbhost_registry_s *usbhost_findclass(const struct usbhost_id_s *id uvdbg("Looking for class:%d subclass:%d protocol:%d vid:%04x pid:%04x\n", id->base, id->subclass, id->proto, id->vid, id->pid); - /* g_classregistry is a singly-linkedlist of class ID information added by + /* g_classregistry is a singly-linked list of class ID information added by * calls to usbhost_registerclass(). Since this list is accessed from USB * host controller interrupt handling logic, accesses to this list must be * protected by disabling interrupts. diff --git a/drivers/usbhost/usbhost_hub.c b/drivers/usbhost/usbhost_hub.c index fa8db6ad94..ae8c3a55a5 100644 --- a/drivers/usbhost/usbhost_hub.c +++ b/drivers/usbhost/usbhost_hub.c @@ -1161,13 +1161,23 @@ static void usbhost_callback(FAR void *arg, int result) * transfer will pend until data is available (OHCI and EHCI). On lower * end host controllers (like STM32 and EFM32), the transfer will fail * immediately when the device NAKs the first attempted interrupt IN - * transfer (with result == EGAIN). In that case (or in the case of + * transfer (with result == EAGAIN). In that case (or in the case of * other errors), we must fall back to polling. */ if (result != OK) { - ulldbg("ERROR: Transfer failed: %d\n", result); + /* This debug output is good to know, but really a nuisance for + * those configurations where we have to fall back to polling. + * FIX: Don't output the message is the result is EAGAIN. + */ + +#if defined(CONFIG_DEBUG_USB) && !defined(CONFIG_DEBUG_VERBOSE) + if (result != EAGAIN) +#endif + { + ulldbg("ERROR: Transfer failed: %d\n", result); + } /* Indicate there there is nothing to do. So when the work is * performed, nothing will happen other than we will set to receive