From 0933df159c5c82f97c6bb811b149fa1158a26087 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Mon, 23 May 2016 14:02:33 +0300 Subject: usb: dwc3: trace: print ep cmd status with a single trace Instead of printing command's status with a separate trace printout, let's print it within a single call. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/debug.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'drivers/usb/dwc3/debug.h') diff --git a/drivers/usb/dwc3/debug.h b/drivers/usb/dwc3/debug.h index e3e0b4111c53..8eed4c7cc76b 100644 --- a/drivers/usb/dwc3/debug.h +++ b/drivers/usb/dwc3/debug.h @@ -280,6 +280,22 @@ static inline const char *dwc3_decode_event(u32 event) return dwc3_ep_event_string(&evt.depevt); } +static inline const char *dwc3_ep_cmd_status_string(int status) +{ + switch (status) { + case -ETIMEDOUT: + return "Timed Out"; + case 0: + return "Successful"; + case DEPEVT_TRANSFER_NO_RESOURCE: + return "No Resource"; + case DEPEVT_TRANSFER_BUS_EXPIRY: + return "Bus Expiry"; + default: + return "UNKNOWN"; + } +} + void dwc3_trace(void (*trace)(struct va_format *), const char *fmt, ...); #ifdef CONFIG_DEBUG_FS -- cgit v1.2.3