Skip to content

Commit

Permalink
USB: usb gadget stack can now -DDEBUG with Kconfig
Browse files Browse the repository at this point in the history
Although the other USB driver directories got taught how use Kconfig
and the Makefile to enable the debugging messages enabled by -DDEBUG,
the gadget stack was overlooked.

This patch remedies that omission, but doesn't update any drivers to
remove previous idiosyncracies in this area ... other than the RNDIS
code, which defined its own DEBUG() macro in a broken way.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Jul 12, 2007
1 parent c67ab13 commit 70790f6
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 82 deletions.
14 changes: 14 additions & 0 deletions drivers/usb/gadget/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ config USB_GADGET
For more information, see <http://www.linux-usb.org/gadget> and
the kernel DocBook documentation for this API.

config USB_GADGET_DEBUG
boolean "Debugging messages"
depends on USB_GADGET && DEBUG_KERNEL && EXPERIMENTAL
help
Many controller and gadget drivers will print some debugging
messages if you use this option to ask for those messages.

Avoid enabling these messages, even if you're actively
debugging such a driver. Many drivers will emit so many
messages that the driver timings are affected, which will
either create new failure modes or remove the one you're
trying to track down. Never enable these messages for a
production build.

config USB_GADGET_DEBUG_FILES
boolean "Debugging information files"
depends on USB_GADGET && PROC_FS
Expand Down
4 changes: 4 additions & 0 deletions drivers/usb/gadget/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#
# USB peripheral controller drivers
#
ifeq ($(CONFIG_USB_GADGET_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif

obj-$(CONFIG_USB_DUMMY_HCD) += dummy_hcd.o
obj-$(CONFIG_USB_NET2280) += net2280.o
obj-$(CONFIG_USB_PXA2XX) += pxa2xx_udc.o
Expand Down
Loading

0 comments on commit 70790f6

Please sign in to comment.