usbcore should probably do the same thing.
This modifies the HCD builds to automatically "-DDEBUG" if CONFIG_USB_DEBUG
is selected. It's just a minor source code cleanup, guaranteeing consistency.
Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Index: g26/drivers/usb/host/Makefile
===================================================================
--- g26.orig/drivers/usb/host/Makefile 2005-11-07 19:17:48.000000000 -0800
+++ g26/drivers/usb/host/Makefile 2005-11-07 19:19:33.000000000 -0800
@@ -2,6 +2,10 @@
# Makefile for USB Host Controller Drivers
#
+ifeq ($(CONFIG_USB_DEBUG),y)
+ EXTRA_CFLAGS += -DDEBUG
+endif
+
obj-$(CONFIG_PCI) += pci-quirks.o
obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o
Index: g26/drivers/usb/host/uhci-hcd.c
===================================================================
--- g26.orig/drivers/usb/host/uhci-hcd.c 2005-11-07 19:19:08.000000000 -0800
+++ g26/drivers/usb/host/uhci-hcd.c 2005-11-07 19:19:33.000000000 -0800
@@ -23,11 +23,6 @@
*/
#include <linux/config.h>
-#ifdef CONFIG_USB_DEBUG
-#define DEBUG
-#else
-#undef DEBUG
-#endif
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/kernel.h>
Index: g26/drivers/usb/host/ehci-hcd.c
===================================================================
--- g26.orig/drivers/usb/host/ehci-hcd.c 2005-11-07 19:19:02.000000000 -0800
+++ g26/drivers/usb/host/ehci-hcd.c 2005-11-07 19:19:33.000000000 -0800
@@ -17,13 +17,6 @@
*/
#include <linux/config.h>
-
-#ifdef CONFIG_USB_DEBUG
- #define DEBUG
-#else
- #undef DEBUG
-#endif
-
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/dmapool.h>
Index: g26/drivers/usb/host/ohci-hcd.c
===================================================================
--- g26.orig/drivers/usb/host/ohci-hcd.c 2005-11-07 19:17:48.000000000 -0800
+++ g26/drivers/usb/host/ohci-hcd.c 2005-11-07 19:19:33.000000000 -0800
@@ -75,13 +75,6 @@
*/
#include <linux/config.h>
-
-#ifdef CONFIG_USB_DEBUG
-# define DEBUG
-#else
-# undef DEBUG
-#endif
-
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/pci.h>
Index: g26/drivers/usb/host/sl811_cs.c
===================================================================
--- g26.orig/drivers/usb/host/sl811_cs.c 2005-11-07 19:17:48.000000000 -0800
+++ g26/drivers/usb/host/sl811_cs.c 2005-11-07 19:19:33.000000000 -0800
@@ -38,7 +38,7 @@ MODULE_LICENSE("GPL");
/* MACROS */
/*====================================================================*/
-#if defined(DEBUG) || defined(CONFIG_USB_DEBUG) || defined(PCMCIA_DEBUG)
+#if defined(DEBUG) || defined(PCMCIA_DEBUG)
static int pc_debug = 0;
module_param(pc_debug, int, 0644);
@@ -129,7 +129,8 @@ static int sl811_hc_init(struct device *
resources[2].end = base_addr + 1;
/* The driver core will probe for us. We know sl811-hcd has been
- * initialized already because of the link order dependency.
+ * initialized already because of the link order dependency created
+ * by referencing "sl811h_driver".
*/
platform_dev.name = sl811h_driver.name;
return platform_device_register(&platform_dev);
Index: g26/drivers/usb/host/pci-quirks.c
===================================================================
--- g26.orig/drivers/usb/host/pci-quirks.c 2005-11-07 19:17:48.000000000 -0800
+++ g26/drivers/usb/host/pci-quirks.c 2005-11-07 19:19:33.000000000 -0800
@@ -9,12 +9,6 @@
*/
#include <linux/config.h>
-#ifdef CONFIG_USB_DEBUG
-#define DEBUG
-#else
-#undef DEBUG
-#endif
-
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/pci.h>
Index: g26/drivers/usb/host/sl811-hcd.c
===================================================================
--- g26.orig/drivers/usb/host/sl811-hcd.c 2005-11-07 19:19:09.000000000 -0800
+++ g26/drivers/usb/host/sl811-hcd.c 2005-11-07 19:19:33.000000000 -0800
@@ -32,13 +32,6 @@
#undef PACKET_TRACE
#include <linux/config.h>
-
-#ifdef CONFIG_USB_DEBUG
-# define DEBUG
-#else
-# undef DEBUG
-#endif
-
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>