提交 654f3118 编写于 作者: G Greg Kroah-Hartman 提交者: Linus Torvalds

[PATCH] USB: move CONFIG_USB_DEBUG checks into the Makefile

This lets us remove a lot of code in the drivers that were all checking
the same thing.  It also found some bugs in a few of the drivers, which
has been fixed up.
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 87cf2039
......@@ -6,3 +6,7 @@ obj-$(CONFIG_USB_CXACRU) += cxacru.o
obj-$(CONFIG_USB_SPEEDTOUCH) += speedtch.o
obj-$(CONFIG_USB_ATM) += usbatm.o
obj-$(CONFIG_USB_XUSBATM) += xusbatm.o
ifeq ($(CONFIG_USB_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif
......@@ -27,14 +27,9 @@
#include <linux/config.h>
/*
#define DEBUG
#define VERBOSE_DEBUG
*/
#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG)
# define DEBUG
#endif
#include <asm/semaphore.h>
#include <linux/atm.h>
#include <linux/atmdev.h>
......
......@@ -14,3 +14,7 @@ ifeq ($(CONFIG_USB_DEVICEFS),y)
endif
obj-$(CONFIG_USB) += usbcore.o
ifeq ($(CONFIG_USB_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif
......@@ -15,14 +15,6 @@
#include <asm/scatterlist.h>
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/usb.h>
#include "hcd.h"
......
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#endif
#include <linux/usb.h>
#include <linux/module.h>
#include <linux/init.h>
......
......@@ -19,12 +19,6 @@
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/errno.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/usb.h>
#include "usb.h"
......
......@@ -17,13 +17,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
......
......@@ -23,11 +23,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#endif
#include <linux/module.h>
#include <linux/version.h>
#include <linux/kernel.h>
......
......@@ -9,11 +9,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/module.h>
......
......@@ -3,13 +3,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/pci.h> /* for scatterlist macros */
#include <linux/usb.h>
#include <linux/module.h>
......
......@@ -12,13 +12,7 @@
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/notifier.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/usb.h>
#include "usb.h"
......
......@@ -12,14 +12,7 @@
#include <linux/config.h>
#include <linux/kernel.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/usb.h>
#include "usb.h"
/* endpoint stuff */
......
......@@ -4,12 +4,6 @@
#include <linux/bitops.h>
#include <linux/slab.h>
#include <linux/init.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/usb.h>
#include "hcd.h"
......
......@@ -22,13 +22,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/module.h>
#include <linux/string.h>
#include <linux/bitops.h>
......
......@@ -42,3 +42,7 @@ obj-$(CONFIG_USB_ACECAD) += acecad.o
obj-$(CONFIG_USB_YEALINK) += yealink.o
obj-$(CONFIG_USB_XPAD) += xpad.o
obj-$(CONFIG_USB_APPLETOUCH) += appletouch.o
ifeq ($(CONFIG_USB_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif
......@@ -40,13 +40,6 @@
*****************************************************************************/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/input.h>
......
......@@ -160,7 +160,8 @@ static int keyspan_load_tester(struct usb_keyspan* dev, int bits_needed)
* though so it's not too big a deal
*/
if (dev->data.pos >= dev->data.len) {
dev_dbg(&dev->udev, "%s - Error ran out of data. pos: %d, len: %d\n",
dev_dbg(&dev->udev->dev,
"%s - Error ran out of data. pos: %d, len: %d\n",
__FUNCTION__, dev->data.pos, dev->data.len);
return -1;
}
......@@ -306,7 +307,7 @@ static void keyspan_check_data(struct usb_keyspan *remote, struct pt_regs *regs)
err("Bad message recieved, no stop bit found.\n");
}
dev_dbg(&remote->udev,
dev_dbg(&remote->udev->dev,
"%s found valid message: system: %d, button: %d, toggle: %d\n",
__FUNCTION__, message.system, message.button, message.toggle);
......
......@@ -40,13 +40,6 @@
*****************************************************************************/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/input.h>
......
......@@ -37,8 +37,6 @@
#include "hid.h"
#include "pid.h"
#define DEBUG
#define CHECK_OWNERSHIP(i, hid_pid) \
((i) < FF_EFFECTS_MAX && i >= 0 && \
test_bit(FF_PID_FLAGS_USED, &hid_pid->effects[(i)].flags) && \
......
......@@ -30,10 +30,6 @@
#include <linux/input.h>
#include <linux/module.h>
#include <linux/init.h>
#if !defined(DEBUG) && defined(CONFIG_USB_DEBUG)
#define DEBUG
#endif
#include <linux/usb.h>
#include <linux/usb_input.h>
......
......@@ -19,3 +19,7 @@ obj-$(CONFIG_USB_TEST) += usbtest.o
obj-$(CONFIG_USB_USS720) += uss720.o
obj-$(CONFIG_USB_SISUSBVGA) += sisusbvga/
ifeq ($(CONFIG_USB_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif
......@@ -30,7 +30,6 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/wait.h>
#undef DEBUG /* include debug macros until it's done */
#include <linux/usb.h>
/*-------------------------------------------------------------------*/
......
......@@ -26,9 +26,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG 1
#endif
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
......
......@@ -393,7 +393,7 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos)
ibuf, this_read, &partial,
8000);
dbg(KERN_DEBUG "read stats: result:%d this_read:%u partial:%u",
dbg("read stats: result:%d this_read:%u partial:%u",
result, this_read, partial);
if (partial) {
......
......@@ -10,9 +10,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG 1
#endif
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
......
#include <linux/config.h>
#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG)
# define DEBUG
#endif
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
......
......@@ -41,8 +41,6 @@
/*****************************************************************************/
#define DEBUG
#include <linux/module.h>
#include <linux/socket.h>
#include <linux/parport.h>
......
......@@ -16,3 +16,7 @@ obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o
obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o
obj-$(CONFIG_USB_USBNET) += usbnet.o
obj-$(CONFIG_USB_ZD1201) += zd1201.o
ifeq ($(CONFIG_USB_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif
......@@ -23,9 +23,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/kmod.h>
#include <linux/sched.h>
......
......@@ -21,9 +21,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>
......
......@@ -18,9 +18,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/kmod.h>
#include <linux/sched.h>
......
......@@ -22,9 +22,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>
......
......@@ -21,9 +21,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>
......
......@@ -28,8 +28,6 @@
* is out of the interrupt routine.
*/
#undef DEBUG
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/init.h>
......
......@@ -21,9 +21,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>
......
......@@ -21,9 +21,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>
......
......@@ -34,9 +34,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>
......
......@@ -21,9 +21,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册