]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] USB: move CONFIG_USB_DEBUG checks into the Makefile
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Nov 2005 17:48:09 +0000 (09:48 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 17 Nov 2005 19:29:55 +0000 (11:29 -0800)
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: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
38 files changed:
drivers/usb/atm/Makefile
drivers/usb/atm/usbatm.h
drivers/usb/core/Makefile
drivers/usb/core/buffer.c
drivers/usb/core/config.c
drivers/usb/core/file.c
drivers/usb/core/hcd-pci.c
drivers/usb/core/hcd.c
drivers/usb/core/hub.c
drivers/usb/core/message.c
drivers/usb/core/notify.c
drivers/usb/core/sysfs.c
drivers/usb/core/urb.c
drivers/usb/core/usb.c
drivers/usb/input/Makefile
drivers/usb/input/itmtouch.c
drivers/usb/input/keyspan_remote.c
drivers/usb/input/mtouchusb.c
drivers/usb/input/pid.c
drivers/usb/input/touchkitusb.c
drivers/usb/misc/Makefile
drivers/usb/misc/auerswald.c
drivers/usb/misc/phidgetservo.c
drivers/usb/misc/rio500.c
drivers/usb/misc/usbled.c
drivers/usb/misc/usbtest.c
drivers/usb/misc/uss720.c
drivers/usb/net/Makefile
drivers/usb/net/asix.c
drivers/usb/net/cdc_ether.c
drivers/usb/net/cdc_subset.c
drivers/usb/net/gl620a.c
drivers/usb/net/net1080.c
drivers/usb/net/pegasus.c
drivers/usb/net/plusb.c
drivers/usb/net/rndis_host.c
drivers/usb/net/usbnet.c
drivers/usb/net/zaurus.c

index 751f297be2ef3ea275104858d111b08c17e55219..85099718c6837d96ccafe58035613a73aa6d02bb 100644 (file)
@@ -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
index 936646457935a3af6aba0750ef27a00e08a2208d..1adacd60d713fc24815cd8fd1141d3852ba79e33 100644 (file)
 #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>
index dd1c4d2a0c3122bdca2776e78e1bd2667288abe7..86d5c380892d08efc4eb556031ddb3afe038ba03 100644 (file)
@@ -14,3 +14,7 @@ ifeq ($(CONFIG_USB_DEVICEFS),y)
 endif
 
 obj-$(CONFIG_USB)      += usbcore.o
+
+ifeq ($(CONFIG_USB_DEBUG),y)
+EXTRA_CFLAGS += -DDEBUG
+endif
index 57e800ac3cee80890eed1871dff6d7093e699bc9..419c9943a7cbde9428aef14df1f266bd7e32c142 100644 (file)
 #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"
 
index 993019500cc38fa6756e7381db6afa5c1361a77d..a9d89c78cc2087f1140b6d89613a1d065d0201cc 100644 (file)
@@ -1,9 +1,4 @@
 #include <linux/config.h>
-
-#ifdef CONFIG_USB_DEBUG
-#define DEBUG
-#endif
-
 #include <linux/usb.h>
 #include <linux/module.h>
 #include <linux/init.h>
index e695308095ae8cbae7a9b131c93bd5a506b9c1dd..37b13368c8145c9ca8522aab5d074d30dc3eb42f 100644 (file)
 #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"
index 84d9e69329bb94de3e710d53fe70e4d65cc2f9f8..7feb829362d63212d5383e6aba652373036e5150 100644 (file)
  */
 
 #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>
index 6c7ca5b08cd60c86dc51f35226bcfdf7ffa7cdc1..5e5f65a475ab95c2d50b372d70d4f5533ad98f6e 100644 (file)
  */
 
 #include <linux/config.h>
-
-#ifdef CONFIG_USB_DEBUG
-#define DEBUG
-#endif
-
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/kernel.h>
index 256d9f6987156d32dbed6a2706bfcc7021dcbf86..840727948d846aa12eb476e4ba5dd07f71f1a2ae 100644 (file)
@@ -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>
index 208c6bd83a8369f840e754aeafe277a452016d16..fe74f99ca5f4bb8dc5f981cce78e86115702c3d2 100644 (file)
@@ -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>
index 37da059eced741a78ca43ac275a5eba9af120c8e..fbbebab52fbd1fbfa23b3d7d48618905067d9424 100644 (file)
 #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"
 
 
index edd83e0144522700d67dd51621d88e0f4a54a1d6..71d881327e88e0aa05611a7acd3967ec1b24b4c4 100644 (file)
 
 #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 */
index f2a1fed2a8024419e76e477fdd57bd8e55792f25..081796726b951bf449b8b827b970cf7eec1b8571 100644 (file)
@@ -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"
 
index 0eefff7bcb3c72cc1daa47a6516edaa90523f6f4..e197ce9353de0f4591ad38861413b7ceb1b66593 100644 (file)
  */
 
 #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>
index 5e03b93f29f66a8dd42278f3c1941bee5d0c2e96..07cb17db42fc1eb8d473649f45873f43d9d821b5 100644 (file)
@@ -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
index 3b581853cf101d6b24962a8fb6d5c9a13513727e..4a50acb39d29acd9ebcdb470f482e402027719ac 100644 (file)
  *****************************************************************************/
 
 #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>
index 5b8d65f62abf20af059be248627f83fe712baf1a..a32cfe51b77de11236b98199ba00461784f479d6 100644 (file)
@@ -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);
 
index 7fce526560ca0f396496a4cd3d9c1f154404c7a3..52cc18cd247d63e25f773c028813391410848a11 100644 (file)
  *****************************************************************************/
 
 #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>
index dca5ee93a4efc8e1d2e386354deac8ad129fb33a..19e015d171aab767a7df15582dded3958b7b8feb 100644 (file)
@@ -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) && \
index 0043e6ebcd1f0ada7cc751bab444e92fae6b6e03..7420c6b84284d34cfbad641216ce056d49f852aa 100644 (file)
 #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>
 
index 862e40a8368963ee43552c30138dbcad0b4aa1c3..6c693bc68e2e8f2ce71df7fe793c988ed3db0c17 100644 (file)
@@ -18,4 +18,8 @@ obj-$(CONFIG_USB_RIO500)      += rio500.o
 obj-$(CONFIG_USB_TEST)         += usbtest.o
 obj-$(CONFIG_USB_USS720)       += uss720.o
 
-obj-$(CONFIG_USB_SISUSBVGA)    += sisusbvga/
\ No newline at end of file
+obj-$(CONFIG_USB_SISUSBVGA)    += sisusbvga/
+
+ifeq ($(CONFIG_USB_DEBUG),y)
+EXTRA_CFLAGS += -DDEBUG
+endif
index 5f33f7c648855f2d3b8979cccde43b429eb658e8..2a28ceeaa66a2e848e3596c41cfe8a65b0f4be5f 100644 (file)
@@ -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>
 
 /*-------------------------------------------------------------------*/
index b84eda631ab58488a7efe3fe35f6041b5fe1bec1..a30d4a6ee8240237943f5ad009582ebc3a490150 100644 (file)
@@ -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>
index 7d02d8ec6b1a68cd71a03445151092e1494ea779..9590dbac5d9a55e78c268d77fdd87e65fa727aa5 100644 (file)
@@ -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) {
index f6ba4c788dbc09f7b00e9b3059e74eaa11cfebc0..3c93921cb6b38e59a8d00ff9b20929feac98a06e 100644 (file)
@@ -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>
index 2997f558159b12cf12e29e5348e307fbd0812aa1..605a2afe34ed614d485aea86195ef7550b073a31 100644 (file)
@@ -1,7 +1,4 @@
 #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>
index 0592cb5e6c4d65c6fdf7ecd6e7777bb145f1d4ab..1cabe7ed91f5a90386af744b3e757d3e8d15db6f 100644 (file)
@@ -41,8 +41,6 @@
 
 /*****************************************************************************/
 
-#define DEBUG
-
 #include <linux/module.h>
 #include <linux/socket.h>
 #include <linux/parport.h>
index 222c0495f791113970616f1dc514b8bda046cab0..a21e6eaabaf67f2f678404b48217741e8f453a8f 100644 (file)
@@ -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
index 252a34fbb42cc24931703fcdbac29d6657942421..542120ef1fd2891015255212e4df7be1c507449c 100644 (file)
@@ -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>
index 652b04bbf6afb3327664c14c471c0b99b586c5c1..c008c981862bfad424f70b7f33e2ff4703332454 100644 (file)
@@ -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>
index f1730b685fd2c3e471e950e189edf03e39018a5e..f05cfb83c82d99b57d76123dc3da2d2f95d0a0c9 100644 (file)
@@ -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>
index c0f263b202a60ea70eeda768593d7ee8337b1190..2455e9a85674584c976db10942e35577c7e1cd31 100644 (file)
@@ -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>
index cee55f8cf64fb5b2ff97b9f146615bcbb91e2146..b3799b1a2b0d56910ab38f2633f64ea477d2ba18 100644 (file)
@@ -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>
index 537eb181d985627d91b9fe6e0cfdcf42d9090fbc..683e3df5d607de3c191f60d04562fcebb5ff030e 100644 (file)
@@ -28,8 +28,6 @@
  *                     is out of the interrupt routine.
  */
 
-#undef DEBUG
-
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/init.h>
index 74c2b3581c768e7c55c655f3e36cb2cefe0fc24c..89856aa0e3b8c5c5e4bd7f684ac035e66e68a56e 100644 (file)
@@ -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>
index b5a925dc1beb2623c97d78973944f5c3157fc1bd..c0ecbab6f6ba0d311ca26d84a74896e22da7b5c8 100644 (file)
@@ -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>
index 74f05c9c84d5f545c5ba994ed5e727c654c68c6d..362d6907c9bba3d68cd54f6898581deca3c7eada 100644 (file)
@@ -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>
index 5d4b7d55b097c8937032e335243a51e510e0dfaa..680d13957af4b27e8ffed4858eafbf8021ae861a 100644 (file)
@@ -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>