+ccflags-$(CONFIG_COMEDI_DEBUG)         := -DDEBUG
+
 comedi-y                               := comedi_fops.o range.o drivers.o \
                                           comedi_buf.o
 comedi-$(CONFIG_COMEDI_PCI_DRIVERS)    += comedi_pci.o
 
     GNU General Public License for more details.
 */
 
-#undef DEBUG
-
 #include "comedi_compat32.h"
 
 #include <linux/module.h>
 #define COMEDI_NUM_SUBDEVICE_MINORS    \
        (COMEDI_NUM_MINORS - COMEDI_NUM_BOARD_MINORS)
 
-#ifdef CONFIG_COMEDI_DEBUG
-int comedi_debug;
-EXPORT_SYMBOL_GPL(comedi_debug);
-module_param(comedi_debug, int, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(comedi_debug,
-                "enable comedi core and driver debugging if non-zero (default 0)"
-               );
-#endif
-
 static int comedi_num_legacy_minors;
 module_param(comedi_num_legacy_minors, int, S_IRUGO);
 MODULE_PARM_DESC(comedi_num_legacy_minors,
 
 
 #include "comedi.h"
 
-#define DPRINTK(format, args...)       do {            \
-       if (comedi_debug)                               \
-               pr_debug("comedi: " format, ## args);   \
-} while (0)
+#define DPRINTK(format, args...)       pr_debug("comedi: " format, ## args);
 
 #define COMEDI_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
 #define COMEDI_VERSION_CODE COMEDI_VERSION(COMEDI_MAJORVERSION, \
        return dev->board_ptr;
 }
 
-#ifdef CONFIG_COMEDI_DEBUG
-extern int comedi_debug;
-#else
-static const int comedi_debug;
-#endif
-
 /*
  * function prototypes
  */
 
 # Makefile for individual comedi drivers
 #
+ccflags-$(CONFIG_COMEDI_DEBUG)         := -DDEBUG
 
 # Comedi "helper" modules
 
 
 #include <pcmcia/cistpl.h>
 #include <pcmcia/ds.h>
 
-#undef DEBUG
-
 #define ATMIO 1
 #undef PCIMIO
 
 
+ccflags-$(CONFIG_COMEDI_DEBUG)         := -DDEBUG
+
 obj-$(CONFIG_COMEDI_KCOMEDILIB)        += kcomedilib.o
 
 kcomedilib-objs := kcomedilib_main.o