summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/dwc3/Makefile6
-rw-r--r--drivers/usb/dwc3/debug.h6
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
index 22420e17d68b..84de1e4151c4 100644
--- a/drivers/usb/dwc3/Makefile
+++ b/drivers/usb/dwc3/Makefile
@@ -3,7 +3,11 @@ CFLAGS_trace.o := -I$(src)
obj-$(CONFIG_USB_DWC3) += dwc3.o
-dwc3-y := core.o debug.o trace.o
+dwc3-y := core.o
+
+ifneq ($(CONFIG_FTRACE),)
+ dwc3-y += debug.o trace.o
+endif
ifneq ($(filter y,$(CONFIG_USB_DWC3_HOST) $(CONFIG_USB_DWC3_DUAL_ROLE)),)
dwc3-y += host.o
diff --git a/drivers/usb/dwc3/debug.h b/drivers/usb/dwc3/debug.h
index b287fc6ab29e..d93780e84f07 100644
--- a/drivers/usb/dwc3/debug.h
+++ b/drivers/usb/dwc3/debug.h
@@ -344,7 +344,13 @@ static inline const char *dwc3_gadget_generic_cmd_status_string(int status)
}
}
+
+#if IS_ENABLED(CONFIG_FTRACE)
void dwc3_trace(void (*trace)(struct va_format *), const char *fmt, ...);
+#else
+static inline void dwc3_trace(void (*trace)(struct va_format *), const char *fmt, ...)
+{ }
+#endif
#ifdef CONFIG_DEBUG_FS
extern void dwc3_debugfs_init(struct dwc3 *);