Re: [PATCH] USB and Driver Core patches for 2.6.10

Greg KH
2005-01-08T07:36:07Z

ChangeSet 1.1938.444.31, 2004/12/22 09:51:50-08:00, duncan.sands@math.u-psud.fr

[PATCH] usb atm: macro consolidation, fixes debugging problem

Hi Greg, the recent reorganisation of the speedtouch driver broke the logic
that turns on debugging output in speedtch.c and usb_atm.c when DEBUG or
CONFIG_USB_DEBUG is set. This patch fixes things up, and moves duplicated
debugging code into the header file.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>

drivers/usb/atm/speedtch.c | 20 --------------------
drivers/usb/atm/usb_atm.c | 17 -----------------
drivers/usb/atm/usb_atm.h | 19 ++++++++++++++++++-
3 files changed, 18 insertions(+), 38 deletions(-)

diff -Nru a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c
--- a/drivers/usb/atm/speedtch.c 2005-01-07 15:40:08 -08:00
+++ b/drivers/usb/atm/speedtch.c 2005-01-07 15:40:08 -08:00
@@ -44,28 +44,8 @@

#include "usb_atm.h"

-/*
-#define DEBUG
-#define VERBOSE_DEBUG
-*/
-
-#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG)
-# define DEBUG
-#endif
-
-#include <linux/usb.h>
-
#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
# define USE_FW_LOADER
-#endif
-
-#ifdef VERBOSE_DEBUG
-static int udsl_print_packet(const unsigned char *data, int len);
-#define PACKETDEBUG(arg...) udsl_print_packet (arg)
-#define vdbg(arg...) dbg (arg)
-#else
-#define PACKETDEBUG(arg...)
-#define vdbg(arg...)
#endif

#define DRIVER_AUTHOR "Johan Verrept, Duncan Sands <duncan.sands@free.fr>"
diff -Nru a/drivers/usb/atm/usb_atm.c b/drivers/usb/atm/usb_atm.c
--- a/drivers/usb/atm/usb_atm.c 2005-01-07 15:40:08 -08:00
+++ b/drivers/usb/atm/usb_atm.c 2005-01-07 15:40:08 -08:00
@@ -83,23 +83,6 @@

#include "usb_atm.h"

-/*
-#define DEBUG
-#define VERBOSE_DEBUG
-*/
-
-#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG)
-# define DEBUG
-#endif
-
-#include <linux/usb.h>
-
-#ifdef DEBUG
-#define UDSL_ASSERT(x) BUG_ON(!(x))
-#else
-#define UDSL_ASSERT(x) do { if (!(x)) warn("failed assertion '" #x "' at line %d", __LINE__); } while(0)
-#endif
-
#ifdef VERBOSE_DEBUG
static int udsl_print_packet(const unsigned char *data, int len);
#define PACKETDEBUG(arg...) udsl_print_packet (arg)
diff -Nru a/drivers/usb/atm/usb_atm.h b/drivers/usb/atm/usb_atm.h
--- a/drivers/usb/atm/usb_atm.h 2005-01-07 15:40:08 -08:00
+++ b/drivers/usb/atm/usb_atm.h 2005-01-07 15:40:08 -08:00
@@ -21,12 +21,29 @@
*
******************************************************************************/

+#include <linux/config.h>
#include <linux/list.h>
-#include <linux/usb.h>
#include <linux/kref.h>
#include <linux/atm.h>
#include <linux/atmdev.h>
#include <asm/semaphore.h>
+
+/*
+#define DEBUG
+#define VERBOSE_DEBUG
+*/
+
+#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG)
+# define DEBUG
+#endif
+
+#include <linux/usb.h>
+
+#ifdef DEBUG
+#define UDSL_ASSERT(x) BUG_ON(!(x))
+#else
+#define UDSL_ASSERT(x) do { if (!(x)) warn("failed assertion '" #x "' at line %d", __LINE__); } while(0)
+#endif

#define UDSL_MAX_RCV_URBS 4
#define UDSL_MAX_SND_URBS 4