[PATCH 01/08] staging:dgap: remove digi debug and tracing code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The original debug and tracing code is no longer required.
This patch removes it

Signed-off-by: Mark Hounschell <markh@xxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/dgap/dgap.c | 564 +++++---------------------------------------
 drivers/staging/dgap/dgap.h |  97 --------
 2 files changed, 58 insertions(+), 603 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 7cb1ad5..f234be7 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -93,9 +93,7 @@ MODULE_SUPPORTED_DEVICE("dgap");
  * NOTE: we use a set of macros to create the variables, which allows
  * us to specify the variable type, name, initial value, and description.
  */
-PARM_INT(debug,		0x00,		0644,	"Driver debugging level");
 PARM_INT(rawreadok,	1,		0644,	"Bypass flip buffers on input");
-PARM_INT(trcbuf_size,	0x100000,	0644,	"Debugging trace buffer size.");
 
 
 /**************************************************************************
@@ -113,7 +111,6 @@ static int		dgap_init_pci(void);
 static int		dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
 static void		dgap_remove_one(struct pci_dev *dev);
 static int		dgap_probe1(struct pci_dev *pdev, int card_type);
-static void		dgap_mbuf(struct board_t *brd, const char *fmt, ...);
 static int		dgap_do_remap(struct board_t *brd);
 static irqreturn_t	dgap_intr(int irq, void *voidbrd);
 
@@ -528,7 +525,7 @@ int dgap_init_module(void)
 {
 	int rc = 0;
 
-	APR(("%s, Digi International Part Number %s\n", DG_NAME, DG_PART));
+	pr_info("%s, Digi International Part Number %s\n", DG_NAME, DG_PART);
 
 	dgap_driver_state = DRIVER_NEED_CONFIG_LOAD;
 
@@ -563,7 +560,6 @@ int dgap_init_module(void)
 		dgap_driver_state = DRIVER_READY;
 	}
 
-	DPR_INIT(("Finished init_module. Returning %d\n", rc));
 	return (rc);
 }
 
@@ -585,7 +581,7 @@ static int dgap_start(void)
 
 		dgap_NumBoards = 0;
 
-		APR(("For the tools package or updated drivers please visit http://www.digi.com\n";));
+		pr_info("For the tools package please visit http://www.digi.com\n";);
 
 		/*
 		 * Register our base character device into the kernel.
@@ -597,10 +593,8 @@ static int dgap_start(void)
 			 * Register management/dpa devices
 			 */
 			rc = register_chrdev(DIGI_DGAP_MAJOR, "dgap", &DgapBoardFops);
-			if (rc < 0) {
-				APR(("Can't register dgap driver device (%d)\n", rc));
+			if (rc < 0)
 				return (rc);
-			}
 
 			dgap_class = class_create(THIS_MODULE, "dgap_mgmt");
 			device_create(dgap_class, NULL,
@@ -614,10 +608,8 @@ static int dgap_start(void)
 		 */
 		rc = dgap_tty_preinit();
 
-		if (rc < 0) {
-			APR(("tty preinit - not enough memory (%d)\n", rc));
+		if (rc < 0)
 			return(rc);
-		}
 
 		/* Start the poller */
 		DGAP_LOCK(dgap_poll_lock, flags);
@@ -660,7 +652,6 @@ static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		rc = dgap_probe1(pdev, ent->driver_data);
 		if (rc == 0) {
 			dgap_NumBoards++;
-			DPR_INIT(("Incrementing numboards to %d\n", dgap_NumBoards));
 			rc = dgap_firmware_load(pdev, ent->driver_data);
 		}
 	}
@@ -798,17 +789,14 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
 	/* get the board structure and prep it */
 	brd = dgap_Board[dgap_NumBoards] =
 	(struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL);
-	if (!brd) {
-		APR(("memory allocation for board structure failed\n"));
+	if (!brd)
 		return(-ENOMEM);
-	}
 
 	/* make a temporary message buffer for the boot messages */
 	brd->msgbuf = brd->msgbuf_head =
 		(char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL);
 	if(!brd->msgbuf) {
 		kfree(brd);
-		APR(("memory allocation for board msgbuf failed\n"));
 		return(-ENOMEM);
 	}
 
@@ -861,10 +849,8 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
 		brd->membase_end = pci_resource_end(pdev, 0);
 	}
 
-	if (!brd->membase) {
-		APR(("card has no PCI IO resources, failing board.\n"));
+	if (!brd->membase)
 		return -ENODEV;
-	}
 
 	if (brd->membase & 1)
 		brd->membase &= ~3;
@@ -905,11 +891,6 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
 	/* init our poll helper tasklet */
 	tasklet_init(&brd->helper_tasklet, dgap_poll_tasklet, (unsigned long) brd);
 
-	 /* Log the information about the board */
-	dgap_mbuf(brd, DRVSTR": board %d: %s (rev %d), irq %d\n",
-		dgap_NumBoards, brd->name, brd->rev, brd->irq);
-
-	DPR_INIT(("dgap_scan(%d) - printing out the msgbuf\n", i));
 	DGAP_LOCK(dgap_global_lock, flags);
 	brd->msgbuf = NULL;
 	printk("%s", brd->msgbuf_head);
@@ -931,13 +912,9 @@ static int dgap_finalize_board_init(struct board_t *brd) {
 
         int rc;
 
-        DPR_INIT(("dgap_finalize_board_init() - start\n"));
-
 	if (!brd || brd->magic != DGAP_BOARD_MAGIC)
                 return(-ENODEV);
 
-        DPR_INIT(("dgap_finalize_board_init() - start #2\n"));
-
 	brd->use_interrupts = dgap_config_get_useintr(brd);
 
 	/*
@@ -947,11 +924,8 @@ static int dgap_finalize_board_init(struct board_t *brd) {
 
 		rc = request_irq(brd->irq, dgap_intr, IRQF_SHARED, "DGAP", brd);
 
-		if (rc) {
-			dgap_mbuf(brd, DRVSTR": Failed to hook IRQ %d. Board will work in poll mode.\n",
-                                  brd->irq);
+		if (rc)
 			brd->intr_used = 0;
-		}
 		else
 			brd->intr_used = 1;
 	} else {
@@ -1094,7 +1068,6 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
 	ret = dgap_tty_init(brd);
 	if (ret < 0) {
 		dgap_tty_uninit(brd);
-		pr_err("dgap: Can't init tty devices (%d)\n", ret);
 		return ret;
 	}
 
@@ -1114,21 +1087,16 @@ static int dgap_do_remap(struct board_t *brd)
 	if (!brd || brd->magic != DGAP_BOARD_MAGIC)
 		return -ENXIO;
 
-	if (!request_mem_region(brd->membase, 0x200000, "dgap")) {
-		APR(("dgap: mem_region %lx already in use.\n", brd->membase));
+	if (!request_mem_region(brd->membase, 0x200000, "dgap"))
 		return -ENOMEM;
-        }
 
 	if (!request_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000, "dgap")) {
-		APR(("dgap: mem_region IO %lx already in use.\n",
-			brd->membase + PCI_IO_OFFSET));
 		release_mem_region(brd->membase, 0x200000);
 		return -ENOMEM;
         }
 
 	brd->re_map_membase = ioremap(brd->membase, 0x200000);
 	if (!brd->re_map_membase) {
-		APR(("dgap: ioremap mem %lx cannot be mapped.\n", brd->membase));
 		release_mem_region(brd->membase, 0x200000);
 		release_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000);
 		return -ENOMEM;
@@ -1139,13 +1107,9 @@ static int dgap_do_remap(struct board_t *brd)
 		release_mem_region(brd->membase, 0x200000);
 		release_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000);
 		iounmap(brd->re_map_membase);
-		APR(("dgap: ioremap IO mem %lx cannot be mapped.\n",
-			brd->membase + PCI_IO_OFFSET));
 		return -ENOMEM;
 	}
 
-	DPR_INIT(("remapped io: 0x%p  remapped mem: 0x%p\n",
-		brd->re_map_port, brd->re_map_membase));
 	return 0;
 }
 
@@ -1284,18 +1248,14 @@ static irqreturn_t dgap_intr(int irq, void *voidbrd)
 {
 	struct board_t *brd = (struct board_t *) voidbrd;
 
-	if (!brd) {
-		APR(("Received interrupt (%d) with null board associated\n", irq));
+	if (!brd)
 		return IRQ_NONE;
-	}
 
 	/*
 	 * Check to make sure its for us.
 	 */
-	if (brd->magic != DGAP_BOARD_MAGIC) {
-		APR(("Received interrupt (%d) with a board pointer that wasn't ours!\n", irq));
+	if (brd->magic != DGAP_BOARD_MAGIC)
 		return IRQ_NONE;
-	}
 
 	brd->intr_count++;
 
@@ -1319,8 +1279,6 @@ static void dgap_init_globals(void)
 	int i = 0;
 
 	dgap_rawreadok		= rawreadok;
-        dgap_trcbuf_size	= trcbuf_size;
-	dgap_debug		= debug;
 
 	for (i = 0; i < MAXBOARDS; i++) {
 		dgap_Board[i] = NULL;
@@ -1339,44 +1297,6 @@ static void dgap_init_globals(void)
  *
  ************************************************************************/
 
-
-/*
- * dgap_mbuf()
- *
- * Used to print to the message buffer during board init.
- */
-static void dgap_mbuf(struct board_t *brd, const char *fmt, ...) {
-	va_list		ap;
-	char		buf[1024];
-	int		i;
-	unsigned long	flags;
-	size_t		length;
-
-	DGAP_LOCK(dgap_global_lock, flags);
-
-	/* Format buf using fmt and arguments contained in ap. */
-	va_start(ap, fmt);
-	i = vsnprintf(buf, sizeof(buf), fmt,  ap);
-	va_end(ap);
-
-	DPR((buf));
-
-	if (!brd || !brd->msgbuf) {
-		printk("%s", buf);
-		DGAP_UNLOCK(dgap_global_lock, flags);
-		return;
-	}
-
-	length = strlen(buf) + 1;
-	if (brd->msgbuf - brd->msgbuf_head < length)
-		length = brd->msgbuf - brd->msgbuf_head;
-	memcpy(brd->msgbuf, buf, length);
-	brd->msgbuf += length;
-
-	DGAP_UNLOCK(dgap_global_lock, flags);
-}
-
-
 /*
  * dgap_ms_sleep()
  *
@@ -1421,7 +1341,6 @@ static int dgap_tty_preinit(void)
 
 	if (!dgap_TmpWriteBuf) {
 		DGAP_UNLOCK(dgap_global_lock, flags);
-		DPR_INIT(("unable to allocate tmp write buf"));
 		return (-ENOMEM);
 	}
 
@@ -1439,8 +1358,6 @@ static int dgap_tty_register(struct board_t *brd)
 {
 	int rc = 0;
 
-	DPR_INIT(("tty_register start"));
-
 	brd->SerialDriver = alloc_tty_driver(MAXPORTS);
 
 	snprintf(brd->SerialName, MAXTTYNAMELEN, "tty_dgap_%d_", brd->boardnum);
@@ -1497,10 +1414,8 @@ static int dgap_tty_register(struct board_t *brd)
 	if (!brd->dgap_Major_Serial_Registered) {
 		/* Register tty devices */
 		rc = tty_register_driver(brd->SerialDriver);
-		if (rc < 0) {
-			APR(("Can't register tty device (%d)\n", rc));
+		if (rc < 0)
 			return(rc);
-		}
 		brd->dgap_Major_Serial_Registered = TRUE;
 		dgap_BoardsByMajor[brd->SerialDriver->major] = brd;
 		brd->dgap_Serial_Major = brd->SerialDriver->major;
@@ -1509,18 +1424,13 @@ static int dgap_tty_register(struct board_t *brd)
 	if (!brd->dgap_Major_TransparentPrint_Registered) {
 		/* Register Transparent Print devices */
  		rc = tty_register_driver(brd->PrintDriver);
-		if (rc < 0) {
-			APR(("Can't register Transparent Print device (%d)\n", rc));
+		if (rc < 0)
 			return(rc);
-		}
 		brd->dgap_Major_TransparentPrint_Registered = TRUE;
 		dgap_BoardsByMajor[brd->PrintDriver->major] = brd;
 		brd->dgap_TransparentPrint_Major = brd->PrintDriver->major;
 	}
 
-	DPR_INIT(("DGAP REGISTER TTY: MAJORS: %d %d\n", brd->SerialDriver->major,
-		brd->PrintDriver->major));
-
 	return (rc);
 }
 
@@ -1545,8 +1455,6 @@ static int dgap_tty_init(struct board_t *brd)
 	if (!brd)
 		return (-ENXIO);
 
-	DPR_INIT(("dgap_tty_init start\n"));
-
 	/*
 	 * Initialize board structure elements.
 	 */
@@ -1565,18 +1473,15 @@ static int dgap_tty_init(struct board_t *brd)
 	}
 
 	if (true_count != brd->nasync) {
-		if ((brd->type == PPCM) && (true_count == 64)) {
-			APR(("***WARNING**** %s configured for %d ports, has %d ports.\nPlease make SURE the EBI cable running from the card\nto each EM module is plugged into EBI IN!\n",
-				brd->name, brd->nasync, true_count));
-		}
-		else if ((brd->type == PPCM) && (true_count == 0)) {
-			APR(("***WARNING**** %s configured for %d ports, has %d ports.\nPlease make SURE the EBI cable running from the card\nto each EM module is plugged into EBI IN!\n",
-				brd->name, brd->nasync, true_count));
-		}
-		else {
-			APR(("***WARNING**** %s configured for %d ports, has %d ports.\n",
-				brd->name, brd->nasync, true_count));
-		}
+		if ((brd->type == PPCM) && (true_count == 64))
+			pr_warn("dgap: %s configured for %d ports, has %d ports.\nPlease make SURE the EBI cable running from the card\nto each EM module is plugged into EBI IN!\n",
+				brd->name, brd->nasync, true_count);
+		else if ((brd->type == PPCM) && (true_count == 0))
+			pr_warn("dgap: %s configured for %d ports, has %d ports.\nPlease make SURE the EBI cable running from the card\nto each EM module is plugged into EBI IN!\n",
+				brd->name, brd->nasync, true_count);
+		else
+			pr_warn("dgap: %s configured for %d ports, has %d ports.\n",
+				brd->name, brd->nasync, true_count);
 
 		brd->nasync = true_count;
 
@@ -1595,10 +1500,8 @@ static int dgap_tty_init(struct board_t *brd)
 	for (i = 0; i < brd->nasync; i++) {
 		if (!brd->channels[i]) {
 			brd->channels[i] = kzalloc(sizeof(struct channel_t), GFP_ATOMIC);
-			if (!brd->channels[i]) {
-				DPR_CORE(("%s:%d Unable to allocate memory for channel struct\n",
-				    __FILE__, __LINE__));
-			}
+			if (!brd->channels[i])
+				return -ENOMEM;
 		}
 	}
 
@@ -1697,9 +1600,6 @@ static int dgap_tty_init(struct board_t *brd)
 		writeb(1, &(ch->ch_bs->idata));
 	}
 
-
-	DPR_INIT(("dgap_tty_init finish\n"));
-
 	return (0);
 }
 
@@ -1913,8 +1813,6 @@ static void dgap_input(struct channel_t *ch)
 	if(!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return;
 
-	DPR_READ(("dgap_input start\n"));
-
 	DGAP_LOCK(bd->bd_lock, lock_flags);
 	DGAP_LOCK(ch->ch_lock, lock_flags2);
 
@@ -1936,7 +1834,6 @@ static void dgap_input(struct channel_t *ch)
 		writeb(1, &(bs->idata));
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 		DGAP_UNLOCK(bd->bd_lock, lock_flags);
-		DPR_READ(("No data on port %d\n", ch->ch_portnum));
 		return;
 	}
 
@@ -1948,9 +1845,6 @@ static void dgap_input(struct channel_t *ch)
             !(ch->ch_tun.un_flags & UN_ISOPEN) || !(tp->termios.c_cflag & CREAD) ||
 	    (ch->ch_tun.un_flags & UN_CLOSING)) {
 
-		DPR_READ(("input. dropping %d bytes on port %d...\n", data_len, ch->ch_portnum));
-		DPR_READ(("input. tp: %p tp->magic: %x MAGIC:%x ch flags: %x\n",
-			tp, tp ? tp->magic : 0, TTY_MAGIC, ch->ch_tun.un_flags));
 		writew(head, &(bs->rx_tail));
 		writeb(1, &(bs->idata));
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
@@ -1965,8 +1859,6 @@ static void dgap_input(struct channel_t *ch)
 		writeb(1, &(bs->idata));
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 		DGAP_UNLOCK(bd->bd_lock, lock_flags);
-		DPR_READ(("Port %d throttled, not reading any data. head: %x tail: %x\n",
-			ch->ch_portnum, head, tail));
 		return;
 	}
 
@@ -1979,8 +1871,6 @@ static void dgap_input(struct channel_t *ch)
 		writeb(0, &(bs->orun));
 	}
 
-	DPR_READ(("dgap_input start 2\n"));
-
 	/* Decide how much data we can send into the tty layer */
 	flip_len = TTY_FLIPBUF_SIZE;
 
@@ -2022,7 +1912,6 @@ static void dgap_input(struct channel_t *ch)
 		writeb(1, &(bs->idata));
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 		DGAP_UNLOCK(bd->bd_lock, lock_flags);
-		DPR_READ(("dgap_input 1 - finish\n"));
 		if (ld)
 			tty_ldisc_deref(ld);
 		return;
@@ -2089,7 +1978,6 @@ static void dgap_input(struct channel_t *ch)
 	if (ld)
 		tty_ldisc_deref(ld);
 
-	DPR_READ(("dgap_input - finish\n"));
 }
 
 
@@ -2104,8 +1992,6 @@ static void dgap_carrier(struct channel_t *ch)
         int virt_carrier = 0;
         int phys_carrier = 0;
 
-	DPR_CARR(("dgap_carrier called...\n"));
-
 	if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
 		return;
 
@@ -2124,10 +2010,8 @@ static void dgap_carrier(struct channel_t *ch)
 		ch->ch_cd       = DM_CD;
 	}
 
-	if (ch->ch_mistat & D_CD(ch)) {
-		DPR_CARR(("mistat: %x  D_CD: %x\n", ch->ch_mistat, D_CD(ch)));
+	if (ch->ch_mistat & D_CD(ch))
 		phys_carrier = 1;
-	}
 
 	if (ch->ch_digi.digi_flags & DIGI_FORCEDCD) {
 		virt_carrier = 1;
@@ -2137,9 +2021,6 @@ static void dgap_carrier(struct channel_t *ch)
 		virt_carrier = 1;
 	}
 
-
-	DPR_CARR(("DCD: physical: %d virt: %d\n", phys_carrier, virt_carrier));
-
 	/*
 	 * Test for a VIRTUAL carrier transition to HIGH.
 	 */
@@ -2150,8 +2031,6 @@ static void dgap_carrier(struct channel_t *ch)
 		 * for carrier in the open routine.
 		 */
 
-		DPR_CARR(("carrier: virt DCD rose\n"));
-
 		if (waitqueue_active(&(ch->ch_flags_wait)))
 			wake_up_interruptible(&ch->ch_flags_wait);
 	}
@@ -2166,8 +2045,6 @@ static void dgap_carrier(struct channel_t *ch)
 		 * for carrier in the open routine.
 		 */
 
-		DPR_CARR(("carrier: physical DCD rose\n"));
-
 		if (waitqueue_active(&(ch->ch_flags_wait)))
 			wake_up_interruptible(&ch->ch_flags_wait);
 	}
@@ -2200,15 +2077,11 @@ static void dgap_carrier(struct channel_t *ch)
 		if (waitqueue_active(&(ch->ch_flags_wait)))
 			wake_up_interruptible(&ch->ch_flags_wait);
 
-		if (ch->ch_tun.un_open_count > 0) {
-			DPR_CARR(("Sending tty hangup\n"));
+		if (ch->ch_tun.un_open_count > 0)
 			tty_hangup(ch->ch_tun.un_tty);
-		}
 
-		if (ch->ch_pun.un_open_count > 0) {
-			DPR_CARR(("Sending pr hangup\n"));
+		if (ch->ch_pun.un_open_count > 0)
 			tty_hangup(ch->ch_pun.un_tty);
-		}
 	}
 
 	/*
@@ -2310,16 +2183,12 @@ static int dgap_tty_open(struct tty_struct *tty, struct file *file)
 	else {
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 		DGAP_UNLOCK(brd->bd_lock, lock_flags);
-		DPR_OPEN(("%d Unknown TYPE!\n", __LINE__));
 		return -ENXIO;
 	}
 
 	/* Store our unit into driver_data, so we always have it available. */
 	tty->driver_data = un;
 
-	DPR_OPEN(("Open called. MAJOR: %d MINOR:%d unit: %p NAME: %s\n",
-		MAJOR(tty_devnum(tty)), MINOR(tty_devnum(tty)), un, brd->name));
-
 	/*
 	 * Error if channel info pointer is NULL.
 	 */
@@ -2327,12 +2196,9 @@ static int dgap_tty_open(struct tty_struct *tty, struct file *file)
 	if (!bs) {
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 		DGAP_UNLOCK(brd->bd_lock, lock_flags);
-		DPR_OPEN(("%d BS is 0!\n", __LINE__));
 		return -ENXIO;
         }
 
-	DPR_OPEN(("%d: tflag=%x  pflag=%x\n", __LINE__, ch->ch_tun.un_flags, ch->ch_pun.un_flags));
-
 	/*
 	 * Initialize tty's
 	 */
@@ -2348,8 +2214,6 @@ static int dgap_tty_open(struct tty_struct *tty, struct file *file)
 	 */
 	if (!((ch->ch_tun.un_flags | ch->ch_pun.un_flags) & UN_ISOPEN)) {
 
-		DPR_OPEN(("dgap_open: initializing channel in open...\n"));
-
 		ch->ch_mforce = 0;
 		ch->ch_mval = 0;
 
@@ -2392,11 +2256,6 @@ static int dgap_tty_open(struct tty_struct *tty, struct file *file)
 		return -ENODEV;
 	}
 
-	if (rc) {
-		DPR_OPEN(("dgap_tty_open returning after dgap_block_til_ready "
-			"with %d\n", rc));
-	}
-
 	/* No going back now, increment our unit and channel counters */
 	DGAP_LOCK(ch->ch_lock, lock_flags);
 	ch->ch_open_count++;
@@ -2404,7 +2263,6 @@ static int dgap_tty_open(struct tty_struct *tty, struct file *file)
 	un->un_flags |= (UN_ISOPEN);
 	DGAP_UNLOCK(ch->ch_lock, lock_flags);
 
-	DPR_OPEN(("dgap_tty_open finished\n"));
 	return (rc);
 }
 
@@ -2431,8 +2289,6 @@ static int dgap_block_til_ready(struct tty_struct *tty, struct file *file, struc
 		return (-ENXIO);
 	}
 
-	DPR_OPEN(("dgap_block_til_ready - before block.\n"));
-
 	DGAP_LOCK(ch->ch_lock, lock_flags);
 
 	ch->ch_wopen++;
@@ -2480,15 +2336,11 @@ static int dgap_block_til_ready(struct tty_struct *tty, struct file *file, struc
 				break;
 			}
 
-			if (ch->ch_flags & CH_CD) {
-				DPR_OPEN(("%d: ch_flags: %x\n", __LINE__, ch->ch_flags));
+			if (ch->ch_flags & CH_CD)
 				break;
-			}
 
-			if (ch->ch_flags & CH_FCAR) {
-				DPR_OPEN(("%d: ch_flags: %x\n", __LINE__, ch->ch_flags));
+			if (ch->ch_flags & CH_FCAR)
 				break;
-			}
 		}
 		else {
 			sleep_on_un_flags = 1;
@@ -2500,13 +2352,10 @@ static int dgap_block_til_ready(struct tty_struct *tty, struct file *file, struc
 		 * Leave loop with error set.
 		 */
 		if (signal_pending(current)) {
-			DPR_OPEN(("%d: signal pending...\n", __LINE__));
 			retval = -ERESTARTSYS;
 			break;
 		}
 
-		DPR_OPEN(("dgap_block_til_ready - blocking.\n"));
-
 		/*
 		 * Store the flags before we let go of channel lock
 		 */
@@ -2523,9 +2372,6 @@ static int dgap_block_til_ready(struct tty_struct *tty, struct file *file, struc
 
 		DGAP_UNLOCK(ch->ch_lock, lock_flags);
 
-		DPR_OPEN(("Going to sleep on %s flags...\n",
-			(sleep_on_un_flags ? "un" : "ch")));
-
 		/*
 		 * Wait for something in the flags to change from the current value.
 		 */
@@ -2538,8 +2384,6 @@ static int dgap_block_til_ready(struct tty_struct *tty, struct file *file, struc
 				(old_flags != ch->ch_flags));
 		}
 
-		DPR_OPEN(("After sleep... retval: %x\n", retval));
-
 		/*
 		 * We got woken up for some reason.
 		 * Before looping around, grab our channel lock.
@@ -2551,14 +2395,8 @@ static int dgap_block_til_ready(struct tty_struct *tty, struct file *file, struc
 
 	DGAP_UNLOCK(ch->ch_lock, lock_flags);
 
-	DPR_OPEN(("dgap_block_til_ready - after blocking.\n"));
-
-	if (retval) {
-		DPR_OPEN(("dgap_block_til_ready - done. error. retval: %x\n", retval));
+	if (retval)
 		return(retval);
-	}
-
-	DPR_OPEN(("dgap_block_til_ready - done no error. jiffies: %lu\n", jiffies));
 
 	return(0);
 }
@@ -2590,14 +2428,9 @@ static void dgap_tty_hangup(struct tty_struct *tty)
 	if (!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return;
 
-	DPR_CLOSE(("dgap_hangup called. ch->ch_open_count: %d un->un_open_count: %d\n",
-		ch->ch_open_count, un->un_open_count));
-
 	/* flush the transmit queues */
 	dgap_tty_flush_buffer(tty);
 
-	DPR_CLOSE(("dgap_hangup finished. ch->ch_open_count: %d un->un_open_count: %d\n",
-		ch->ch_open_count, un->un_open_count));
 }
 
 
@@ -2632,15 +2465,13 @@ static void dgap_tty_close(struct tty_struct *tty, struct file *file)
 
 	ts = &tty->termios;
 
-	DPR_CLOSE(("Close called\n"));
-
 	DGAP_LOCK(ch->ch_lock, lock_flags);
 
 	/*
 	 * Determine if this is the last close or not - and if we agree about
 	 * which type of close it is with the Line Discipline
 	 */
-	if ((tty->count == 1) && (un->un_open_count != 1)) {
+	if ((tty->count == 1) && (un->un_open_count != 1))
 		/*
 		 * Uh, oh.  tty->count is 1, which means that the tty
 		 * structure will be freed.  un_open_count should always
@@ -2648,27 +2479,19 @@ static void dgap_tty_close(struct tty_struct *tty, struct file *file)
 		 * one, we've got real problems, since it means the
 		 * serial port won't be shutdown.
 		 */
-		APR(("tty->count is 1, un open count is %d\n", un->un_open_count));
 		un->un_open_count = 1;
-	}
 
-	if (--un->un_open_count < 0) {
-		APR(("bad serial port open count of %d\n", un->un_open_count));
+	if (--un->un_open_count < 0)
 		un->un_open_count = 0;
-	}
 
 	ch->ch_open_count--;
 
 	if (ch->ch_open_count && un->un_open_count) {
-		DPR_CLOSE(("dgap_tty_close: not last close ch: %d un:%d\n",
-			ch->ch_open_count, un->un_open_count));
-
 		DGAP_UNLOCK(ch->ch_lock, lock_flags);
                 return;
         }
 
 	/* OK, its the last close on the unit */
-	DPR_CLOSE(("dgap_tty_close - last close on unit procedures\n"));
 
 	un->un_flags |= UN_CLOSING;
 
@@ -2687,13 +2510,7 @@ static void dgap_tty_close(struct tty_struct *tty, struct file *file)
 		/* wait for output to drain */
 		/* This will also return if we take an interrupt */
 
-		DPR_CLOSE(("Calling wait_for_drain\n"));
 		rc = dgap_wait_for_drain(tty);
-		DPR_CLOSE(("After calling wait_for_drain\n"));
-
-		if (rc) {
-			DPR_BASIC(("dgap_tty_close - bad return: %d ", rc));
-		}
 
 		dgap_tty_flush_buffer(tty);
 		tty_ldisc_flush(tty);
@@ -2706,7 +2523,6 @@ static void dgap_tty_close(struct tty_struct *tty, struct file *file)
 		 * If we have HUPCL set, lower DTR and RTS
 		 */
 		if (ch->ch_c_cflag & HUPCL ) {
-			DPR_CLOSE(("Close. HUPCL set, dropping DTR/RTS\n"));
 			ch->ch_mostat &= ~(D_RTS(ch)|D_DTR(ch));
 			dgap_cmdb( ch, SMODEM, 0, D_DTR(ch)|D_RTS(ch), 0 );
 
@@ -2715,13 +2531,9 @@ static void dgap_tty_close(struct tty_struct *tty, struct file *file)
 			 * have been dropped for modems to see it.
 			 */
 			if (ch->ch_close_delay) {
-				DPR_CLOSE(("Close. Sleeping for RTS/DTR drop\n"));
-
 				DGAP_UNLOCK(ch->ch_lock, lock_flags);
 				dgap_ms_sleep(ch->ch_close_delay);
 				DGAP_LOCK(ch->ch_lock, lock_flags);
-
-				DPR_CLOSE(("Close. After sleeping for RTS/DTR drop\n"));
 			}
 		}
 
@@ -2744,13 +2556,10 @@ static void dgap_tty_close(struct tty_struct *tty, struct file *file)
 	un->un_flags &= ~(UN_ISOPEN | UN_CLOSING);
 	tty->driver_data = NULL;
 
-	DPR_CLOSE(("Close. Doing wakeups\n"));
 	wake_up_interruptible(&ch->ch_flags_wait);
 	wake_up_interruptible(&un->un_flags_wait);
 
 	DGAP_UNLOCK(ch->ch_lock, lock_flags);
-
-        DPR_BASIC(("dgap_tty_close - complete\n"));
 }
 
 
@@ -2851,8 +2660,6 @@ static int dgap_tty_chars_in_buffer(struct tty_struct *tty)
 		}
 	}
 
- 	DPR_WRITE(("dgap_tty_chars_in_buffer. Port: %x - %d (head: %d tail: %d tsize: %d)\n",
-		ch->ch_portnum, chars, thead, ttail, ch->ch_tsize));
         return(chars);
 }
 
@@ -2883,8 +2690,6 @@ static int dgap_wait_for_drain(struct tty_struct *tty)
 
 	ret = 0;
 
-	DPR_DRAIN(("dgap_wait_for_drain start\n"));
-
 	/* Loop until data is drained */
 	while (count != 0) {
 
@@ -2911,7 +2716,6 @@ static int dgap_wait_for_drain(struct tty_struct *tty)
 	un->un_flags &= ~(UN_EMPTY);
 	DGAP_UNLOCK(ch->ch_lock, lock_flags);
 
-	DPR_DRAIN(("dgap_wait_for_drain finish\n"));
 	return (ret);
 }
 
@@ -3071,8 +2875,6 @@ static int dgap_tty_write_room(struct tty_struct *tty)
 	dgap_set_firmware_event(un, UN_LOW | UN_EMPTY);
 	DGAP_UNLOCK(ch->ch_lock, lock_flags);
 
-	DPR_WRITE(("dgap_tty_write_room - %d tail: %d head: %d\n", ret, tail, head));
-
         return(ret);
 }
 
@@ -3089,7 +2891,6 @@ static int dgap_tty_put_char(struct tty_struct *tty, unsigned char c)
 	/*
 	 * Simply call tty_write.
 	 */
-	DPR_WRITE(("dgap_tty_put_char called\n"));
 	dgap_tty_write(tty, &c, 1);
 	return 1;
 }
@@ -3131,9 +2932,6 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int
 	if (!count)
 		return(0);
 
-	DPR_WRITE(("dgap_tty_write: Port: %x tty=%p user=%d len=%d\n",
-		ch->ch_portnum, tty, from_user, count));
-
 	/*
 	 * Store original amount of characters passed in.
 	 * This helps to figure out if we should ask the FEP
@@ -3151,9 +2949,6 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int
 	if ((bufcount = tail - head - 1) < 0)
 		bufcount += ch->ch_tsize;
 
-	DPR_WRITE(("%d: bufcount: %x count: %x tail: %x head: %x tmask: %x\n",
-		__LINE__, bufcount, count, tail, head, tmask));
-
 	/*
 	 * Limit printer output to maxcps overall, with bursts allowed
 	 * up to bufsize characters.
@@ -3313,8 +3108,6 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int
 		DGAP_UNLOCK(ch->ch_lock, lock_flags);
 	}
 
-	DPR_WRITE(("Write finished - Write %d bytes of %d.\n", count, orig_count));
-
 	return (count);
 }
 
@@ -3342,8 +3135,6 @@ static int dgap_tty_tiocmget(struct tty_struct *tty)
 	if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
 		return result;
 
-	DPR_IOCTL(("dgap_tty_tiocmget start\n"));
-
 	DGAP_LOCK(ch->ch_lock, lock_flags);
 
 	mstat = readb(&(ch->ch_bs->m_stat));
@@ -3367,8 +3158,6 @@ static int dgap_tty_tiocmget(struct tty_struct *tty)
 	if (mstat & D_CD(ch))
 		result |= TIOCM_CD;
 
-	DPR_IOCTL(("dgap_tty_tiocmget finish\n"));
-
 	return result;
 }
 
@@ -3404,8 +3193,6 @@ static int dgap_tty_tiocmset(struct tty_struct *tty,
 	if (!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return ret;
 
-	DPR_IOCTL(("dgap_tty_tiocmset start\n"));
-
 	DGAP_LOCK(bd->bd_lock, lock_flags);
 	DGAP_LOCK(ch->ch_lock, lock_flags2);
 
@@ -3434,8 +3221,6 @@ static int dgap_tty_tiocmset(struct tty_struct *tty,
 	DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 	DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-	DPR_IOCTL(("dgap_tty_tiocmset finish\n"));
-
 	return (0);
 }
 
@@ -3482,8 +3267,6 @@ static int dgap_tty_send_break(struct tty_struct *tty, int msec)
 		break;
 	}
 
-	DPR_IOCTL(("dgap_tty_send_break start 1.  %lx\n", jiffies));
-
 	DGAP_LOCK(bd->bd_lock, lock_flags);
 	DGAP_LOCK(ch->ch_lock, lock_flags2);
 #if 0
@@ -3494,8 +3277,6 @@ static int dgap_tty_send_break(struct tty_struct *tty, int msec)
 	DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 	DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-	DPR_IOCTL(("dgap_tty_send_break finish\n"));
-
 	return (0);
 }
 
@@ -3509,13 +3290,7 @@ static int dgap_tty_send_break(struct tty_struct *tty, int msec)
  */
 static void dgap_tty_wait_until_sent(struct tty_struct *tty, int timeout)
 {
-	int rc;
-	rc = dgap_wait_for_drain(tty);
-	if (rc) {
-		DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
-		return;
-	}
-	return;
+	dgap_wait_for_drain(tty);
 }
 
 
@@ -3548,8 +3323,6 @@ static void dgap_tty_send_xchar(struct tty_struct *tty, char c)
 	if (!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return;
 
-	DPR_IOCTL(("dgap_tty_send_xchar start 1.  %lx\n", jiffies));
-
 	DGAP_LOCK(bd->bd_lock, lock_flags);
 	DGAP_LOCK(ch->ch_lock, lock_flags2);
 
@@ -3577,8 +3350,6 @@ static void dgap_tty_send_xchar(struct tty_struct *tty, char c)
 	DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 	DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-	DPR_IOCTL(("dgap_tty_send_xchar finish\n"));
-
 	return;
 }
 
@@ -3595,8 +3366,6 @@ static int dgap_get_modem_info(struct channel_t *ch, unsigned int __user *value)
 	ulong lock_flags;
 	int rc = 0;
 
-	DPR_IOCTL(("dgap_get_modem_info start\n"));
-
 	if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
 		return(-ENXIO);
 
@@ -3625,7 +3394,6 @@ static int dgap_get_modem_info(struct channel_t *ch, unsigned int __user *value)
 
 	rc = put_user(result, value);
 
-	DPR_IOCTL(("dgap_get_modem_info finish\n"));
 	return(rc);
 }
 
@@ -3660,15 +3428,9 @@ static int dgap_set_modem_info(struct tty_struct *tty, unsigned int command, uns
 	if (!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return ret;
 
-	DPR_IOCTL(("dgap_set_modem_info() start\n"));
-
 	ret = get_user(arg, value);
-	if (ret) {
-		DPR_IOCTL(("dgap_set_modem_info %d ret: %x. finished.\n", __LINE__, ret));
+	if (ret)
 		return(ret);
-	}
-
-	DPR_IOCTL(("dgap_set_modem_info: command: %x arg: %x\n", command, arg));
 
 	switch (command) {
 	case TIOCMBIS:
@@ -3728,8 +3490,6 @@ static int dgap_set_modem_info(struct tty_struct *tty, unsigned int command, uns
 	DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 	DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-	DPR_IOCTL(("dgap_set_modem_info finish\n"));
-
 	return (0);
 }
 
@@ -3793,8 +3553,6 @@ static int dgap_tty_digiseta(struct tty_struct *tty, struct digi_t __user *new_i
 	ulong   lock_flags = 0;
 	unsigned long lock_flags2;
 
-	DPR_IOCTL(("DIGI_SETA start\n"));
-
 	if (!tty || tty->magic != TTY_MAGIC)
 		return (-EFAULT);
 
@@ -3810,10 +3568,8 @@ static int dgap_tty_digiseta(struct tty_struct *tty, struct digi_t __user *new_i
 	if (!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return (-EFAULT);
 
-        if (copy_from_user(&new_digi, new_info, sizeof(struct digi_t))) {
-		DPR_IOCTL(("DIGI_SETA failed copy_from_user\n"));
-                return(-EFAULT);
-	}
+	if (copy_from_user(&new_digi, new_info, sizeof(struct digi_t)))
+		return -EFAULT;
 
 	DGAP_LOCK(bd->bd_lock, lock_flags);
 	DGAP_LOCK(ch->ch_lock, lock_flags2);
@@ -3846,8 +3602,6 @@ static int dgap_tty_digiseta(struct tty_struct *tty, struct digi_t __user *new_i
 	DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 	DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-	DPR_IOCTL(("DIGI_SETA finish\n"));
-
 	return(0);
 }
 
@@ -3909,8 +3663,6 @@ static int dgap_tty_digisetedelay(struct tty_struct *tty, int __user *new_info)
 	ulong lock_flags;
 	ulong lock_flags2;
 
-	DPR_IOCTL(("DIGI_SETA start\n"));
-
 	if (!tty || tty->magic != TTY_MAGIC)
 		return (-EFAULT);
 
@@ -3926,10 +3678,8 @@ static int dgap_tty_digisetedelay(struct tty_struct *tty, int __user *new_info)
 	if (!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return (-EFAULT);
 
-        if (copy_from_user(&new_digi, new_info, sizeof(int))) {
-		DPR_IOCTL(("DIGI_SETEDELAY failed copy_from_user\n"));
-                return(-EFAULT);
-	}
+	if (copy_from_user(&new_digi, new_info, sizeof(int)))
+		return -EFAULT;
 
 	DGAP_LOCK(bd->bd_lock, lock_flags);
 	DGAP_LOCK(ch->ch_lock, lock_flags2);
@@ -3941,8 +3691,6 @@ static int dgap_tty_digisetedelay(struct tty_struct *tty, int __user *new_info)
 	DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 	DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-	DPR_IOCTL(("DIGI_SETA finish\n"));
-
 	return(0);
 }
 
@@ -3979,8 +3727,6 @@ static int dgap_tty_digigetcustombaud(struct tty_struct *tty, int __user *retinf
 	tmp = dgap_get_custom_baud(ch);
 	DGAP_UNLOCK(ch->ch_lock, lock_flags);
 
-	DPR_IOCTL(("DIGI_GETCUSTOMBAUD. Returning %d\n", tmp));
-
 	if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
 		return (-EFAULT);
 
@@ -4002,8 +3748,6 @@ static int dgap_tty_digisetcustombaud(struct tty_struct *tty, int __user *new_in
 	ulong lock_flags;
 	ulong lock_flags2;
 
-	DPR_IOCTL(("DIGI_SETCUSTOMBAUD start\n"));
-
 	if (!tty || tty->magic != TTY_MAGIC)
 		return (-EFAULT);
 
@@ -4020,15 +3764,11 @@ static int dgap_tty_digisetcustombaud(struct tty_struct *tty, int __user *new_in
 		return (-EFAULT);
 
 
-	if (copy_from_user(&new_rate, new_info, sizeof(unsigned int))) {
-		DPR_IOCTL(("DIGI_SETCUSTOMBAUD failed copy_from_user\n"));
+	if (copy_from_user(&new_rate, new_info, sizeof(unsigned int)))
 		return(-EFAULT);
-	}
 
 	if (bd->bd_flags & BD_FEP5PLUS) {
 
-		DPR_IOCTL(("DIGI_SETCUSTOMBAUD. Setting %d\n", new_rate));
-
 		DGAP_LOCK(bd->bd_lock, lock_flags);
 		DGAP_LOCK(ch->ch_lock, lock_flags2);
 
@@ -4040,8 +3780,6 @@ static int dgap_tty_digisetcustombaud(struct tty_struct *tty, int __user *new_in
 		DGAP_UNLOCK(bd->bd_lock, lock_flags);
 	}
 
-	DPR_IOCTL(("DIGI_SETCUSTOMBAUD finish\n"));
-
 	return(0);
 }
 
@@ -4113,8 +3851,6 @@ static void dgap_tty_throttle(struct tty_struct *tty)
 	if (!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return;
 
-	DPR_IOCTL(("dgap_tty_throttle start\n"));
-
 	DGAP_LOCK(bd->bd_lock, lock_flags);
 	DGAP_LOCK(ch->ch_lock, lock_flags2);
 
@@ -4126,7 +3862,6 @@ static void dgap_tty_throttle(struct tty_struct *tty)
 	DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 	DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-	DPR_IOCTL(("dgap_tty_throttle finish\n"));
 }
 
 
@@ -4153,8 +3888,6 @@ static void dgap_tty_unthrottle(struct tty_struct *tty)
 	if (!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return;
 
-	DPR_IOCTL(("dgap_tty_unthrottle start\n"));
-
 	DGAP_LOCK(bd->bd_lock, lock_flags);
 	DGAP_LOCK(ch->ch_lock, lock_flags2);
 
@@ -4166,8 +3899,6 @@ static void dgap_tty_unthrottle(struct tty_struct *tty)
 
 	DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 	DGAP_UNLOCK(bd->bd_lock, lock_flags);
-
-	DPR_IOCTL(("dgap_tty_unthrottle finish\n"));
 }
 
 
@@ -4194,8 +3925,6 @@ static void dgap_tty_start(struct tty_struct *tty)
 	if (!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return;
 
-	DPR_IOCTL(("dgap_tty_start start\n"));
-
 	DGAP_LOCK(bd->bd_lock, lock_flags);
 	DGAP_LOCK(ch->ch_lock, lock_flags2);
 
@@ -4204,7 +3933,6 @@ static void dgap_tty_start(struct tty_struct *tty)
 	DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 	DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-	DPR_IOCTL(("dgap_tty_start finish\n"));
 }
 
 
@@ -4231,8 +3959,6 @@ static void dgap_tty_stop(struct tty_struct *tty)
 	if (!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return;
 
-	DPR_IOCTL(("dgap_tty_stop start\n"));
-
 	DGAP_LOCK(bd->bd_lock, lock_flags);
 	DGAP_LOCK(ch->ch_lock, lock_flags2);
 
@@ -4241,7 +3967,6 @@ static void dgap_tty_stop(struct tty_struct *tty)
 	DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 	DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-	DPR_IOCTL(("dgap_tty_stop finish\n"));
 }
 
 
@@ -4281,8 +4006,6 @@ static void dgap_tty_flush_chars(struct tty_struct *tty)
 	if (!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return;
 
-	DPR_IOCTL(("dgap_tty_flush_chars start\n"));
-
 	DGAP_LOCK(bd->bd_lock, lock_flags);
 	DGAP_LOCK(ch->ch_lock, lock_flags2);
 
@@ -4290,8 +4013,6 @@ static void dgap_tty_flush_chars(struct tty_struct *tty)
 
 	DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 	DGAP_UNLOCK(bd->bd_lock, lock_flags);
-
-	DPR_IOCTL(("dgap_tty_flush_chars finish\n"));
 }
 
 
@@ -4325,8 +4046,6 @@ static void dgap_tty_flush_buffer(struct tty_struct *tty)
 	if (!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return;
 
-	DPR_IOCTL(("dgap_tty_flush_buffer on port: %d start\n", ch->ch_portnum));
-
 	DGAP_LOCK(bd->bd_lock, lock_flags);
 	DGAP_LOCK(ch->ch_lock, lock_flags2);
 
@@ -4348,8 +4067,6 @@ static void dgap_tty_flush_buffer(struct tty_struct *tty)
 	if (waitqueue_active(&tty->write_wait))
 		wake_up_interruptible(&tty->write_wait);
 	tty_wakeup(tty);
-
-	DPR_IOCTL(("dgap_tty_flush_buffer finish\n"));
 }
 
 
@@ -4392,14 +4109,10 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 	if (!bd || bd->magic != DGAP_BOARD_MAGIC)
 		return (-ENODEV);
 
-	DPR_IOCTL(("dgap_tty_ioctl start on port %d - cmd %s (%x), arg %lx\n",
-		ch->ch_portnum, dgap_ioctl_name(cmd), cmd, arg));
-
 	DGAP_LOCK(bd->bd_lock, lock_flags);
 	DGAP_LOCK(ch->ch_lock, lock_flags2);
 
 	if (un->un_open_count <= 0) {
-		DPR_BASIC(("dgap_tty_ioctl - unit not open.\n"));
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 		DGAP_UNLOCK(bd->bd_lock, lock_flags);
 		return(-EIO);
@@ -4427,10 +4140,8 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 
 		rc = dgap_wait_for_drain(tty);
 
-		if (rc) {
-			DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
+		if (rc)
 			return(-EINTR);
-		}
 
 		DGAP_LOCK(bd->bd_lock, lock_flags);
 		DGAP_LOCK(ch->ch_lock, lock_flags2);
@@ -4442,9 +4153,6 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 		DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-		DPR_IOCTL(("dgap_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n",
-			ch->ch_portnum, dgap_ioctl_name(cmd), cmd, arg));
-
                 return(0);
 
 
@@ -4463,10 +4171,8 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 		}
 
 		rc = dgap_wait_for_drain(tty);
-		if (rc) {
-			DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
+		if (rc)
 			return(-EINTR);
-		}
 
 		DGAP_LOCK(bd->bd_lock, lock_flags);
 		DGAP_LOCK(ch->ch_lock, lock_flags2);
@@ -4476,9 +4182,6 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 		DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-		DPR_IOCTL(("dgap_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n",
-			ch->ch_portnum, dgap_ioctl_name(cmd), cmd, arg));
-
 		return(0);
 
         case TIOCSBRK:
@@ -4496,10 +4199,8 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 		}
 
 		rc = dgap_wait_for_drain(tty);
-		if (rc) {
-			DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
+		if (rc)
 			return(-EINTR);
-		}
 
 		DGAP_LOCK(bd->bd_lock, lock_flags);
 		DGAP_LOCK(ch->ch_lock, lock_flags2);
@@ -4509,9 +4210,6 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 		DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-		DPR_IOCTL(("dgap_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n",
-			ch->ch_portnum, dgap_ioctl_name(cmd), cmd, arg));
-
 		return 0;
 
         case TIOCCBRK:
@@ -4619,9 +4317,6 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 		DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-		DPR_IOCTL(("dgap_tty_ioctl (LINE:%d) finish on port %d - cmd %s (%x), arg %lx\n",
-			__LINE__, ch->ch_portnum, dgap_ioctl_name(cmd), cmd, arg));
-
 		return(-ENOIOCTLCMD);
 
 	case TCSETSF:
@@ -4646,13 +4341,8 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 		DGAP_UNLOCK(bd->bd_lock, lock_flags);
 		rc = dgap_wait_for_drain(tty);
-		if (rc) {
-			DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
+		if (rc)
 			return(-EINTR);
-		}
-
-		DPR_IOCTL(("dgap_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n",
-			ch->ch_portnum, dgap_ioctl_name(cmd), cmd, arg));
 
 		/* pretend we didn't recognize this */
 		return(-ENOIOCTLCMD);
@@ -4662,10 +4352,8 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 		DGAP_UNLOCK(bd->bd_lock, lock_flags);
 		rc = dgap_wait_for_drain(tty);
-		if (rc) {
-			DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
+		if (rc)
 			return(-EINTR);
-		}
 
 		/* pretend we didn't recognize this */
 		return(-ENOIOCTLCMD);
@@ -4685,7 +4373,6 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 			return(rc);
 		}
 
-		DPR_IOCTL(("dgap_ioctl - in TCXONC - %d\n", cmd));
 		switch (arg) {
 
 		case TCOON:
@@ -4729,10 +4416,8 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 			DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 			DGAP_UNLOCK(bd->bd_lock, lock_flags);
 			rc = dgap_wait_for_drain(tty);
-			if (rc) {
-				DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
+			if (rc)
 				return(-EINTR);
-			}
 			DGAP_LOCK(bd->bd_lock, lock_flags);
 			DGAP_LOCK(ch->ch_lock, lock_flags2);
 		}
@@ -4777,10 +4462,6 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 		DGAP_UNLOCK(ch->ch_lock, lock_flags2);
 		DGAP_UNLOCK(bd->bd_lock, lock_flags);
 
-		DPR_IOCTL(("dgap_tty_ioctl - in default\n"));
-		DPR_IOCTL(("dgap_tty_ioctl end - cmd %s (%x), arg %lx\n",
-			dgap_ioctl_name(cmd), cmd, arg));
-
 		return(-ENOIOCTLCMD);
 	}
 }
@@ -4848,8 +4529,6 @@ static void dgap_do_bios_load(struct board_t *brd, uchar __user *ubios, int len)
 	if (!brd || (brd->magic != DGAP_BOARD_MAGIC) || !brd->re_map_membase)
 		return;
 
-	DPR_INIT(("dgap_do_bios_load() start\n"));
-
 	addr = brd->re_map_membase;
 
 	/*
@@ -4897,7 +4576,6 @@ static void dgap_do_wait_for_bios(struct board_t *brd)
 	while (brd->wait_for_bios < 1000) {
 		/* Check to see if BIOS thinks board is good. (GD). */
 		if (word == *(u16 *) "GD") {
-			DPR_INIT(("GOT GD in memory, moving states.\n"));
 			brd->state = FINISHED_BIOS_LOAD;
 			return;
 		}
@@ -4909,8 +4587,8 @@ static void dgap_do_wait_for_bios(struct board_t *brd)
 	/* Gave up on board after too long of time taken */
 	err1 = readw(addr + SEQUENCE);
 	err2 = readw(addr + ERROR);
-	APR(("***WARNING*** %s failed diagnostics.  Error #(%x,%x).\n",
-		brd->name, err1, err2));
+	pr_warn("dgap: %s failed diagnostics.  Error #(%x,%x).\n",
+		brd->name, err1, err2);
 	brd->state = BOARD_FAILED;
 	brd->dpastatus = BD_NOBIOS;
 }
@@ -4930,8 +4608,6 @@ static void dgap_do_fep_load(struct board_t *brd, uchar *ufep, int len)
 
 	addr = brd->re_map_membase;
 
-	DPR_INIT(("dgap_do_fep_load() for board %s : start\n", brd->name));
-
 	/*
 	 * Download FEP
 	 */
@@ -4961,8 +4637,6 @@ static void dgap_do_fep_load(struct board_t *brd, uchar *ufep, int len)
 	writel(0xbfc01004, (addr + 0xc34));
 	writel(0x3, (addr + 0xc30));
 
-	DPR_INIT(("dgap_do_fep_load() for board %s : finish\n", brd->name));
-
 }
 
 
@@ -5008,12 +4682,10 @@ static void dgap_do_wait_for_fep(struct board_t *brd)
 	/* Gave up on board after too long of time taken */
 	err1 = readw(addr + SEQUENCE);
 	err2 = readw(addr + ERROR);
-	APR(("***WARNING*** FEPOS for %s not functioning.  Error #(%x,%x).\n",
-		brd->name, err1, err2));
+	pr_warn("dgap: FEPOS for %s not functioning.  Error #(%x,%x).\n",
+		brd->name, err1, err2);
 	brd->state = BOARD_FAILED;
 	brd->dpastatus = BD_NOFEP;
-
-	DPR_INIT(("dgap_do_wait_for_fep() for board %s : finish\n", brd->name));
 }
 
 
@@ -5028,13 +4700,9 @@ static void dgap_do_reset_board(struct board_t *brd)
 	int i = 0;
 
 	if (!brd || (brd->magic != DGAP_BOARD_MAGIC) || !brd->re_map_membase || !brd->re_map_port) {
-		DPR_INIT(("dgap_do_reset_board() start. bad values. brd: %p mem: %p io: %p\n",
-			brd, brd ? brd->re_map_membase : 0, brd ? brd->re_map_port : 0));
 		return;
 	}
 
-	DPR_INIT(("dgap_do_reset_board() start. io: %p\n", brd->re_map_port));
-
 	/* FEPRST does not vary among supported boards */
 	writeb(FEPRST, brd->re_map_port);
 
@@ -5046,10 +4714,10 @@ static void dgap_do_reset_board(struct board_t *brd)
 
 	}
 	if (i > 1000) {
-		APR(("*** WARNING *** Board not resetting...  Failing board.\n"));
+		pr_warn("dgap: Board not resetting...  Failing board.\n");
 		brd->state = BOARD_FAILED;
 		brd->dpastatus = BD_NOFEP;
-		goto failed;
+		return;
 	}
 
 	/*
@@ -5061,17 +4729,15 @@ static void dgap_do_reset_board(struct board_t *brd)
 	check2 = readl(brd->re_map_membase + HIGHMEM);
 
 	if ((check1 != 0xa55a3cc3) || (check2 != 0x5aa5c33c)) {
-		APR(("*** Warning *** No memory at %p for board.\n", brd->re_map_membase));
+		pr_warn("dgap: No memory at %p for board.\n",
+			brd->re_map_membase);
 		brd->state = BOARD_FAILED;
 		brd->dpastatus = BD_NOFEP;
-		goto failed;
+		return;
 	}
 
 	if (brd->state != BOARD_FAILED)
 		brd->state = FINISHED_RESET;
-
-failed:
-	DPR_INIT(("dgap_do_reset_board() finish\n"));
 }
 
 
@@ -5217,10 +4883,8 @@ static void dgap_poll_tasklet(unsigned long data)
 	char *vaddr;
 	u16 head, tail;
 
-	if (!bd || (bd->magic != DGAP_BOARD_MAGIC)) {
-		APR(("dgap_poll_tasklet() - NULL or bad bd.\n"));
+	if (!bd || (bd->magic != DGAP_BOARD_MAGIC))
 		return;
-	}
 
 	if (bd->inhibit_poller)
 		return;
@@ -5391,7 +5055,6 @@ out:
 
 		if (rc < 0) {
 			dgap_tty_uninit(bd);
-			APR(("Can't init tty devices (%d)\n", rc));
 			bd->state = BOARD_FAILED;
 			bd->dpastatus = BD_NOFEP;
 		}
@@ -5464,10 +5127,8 @@ static void dgap_cmdb(struct channel_t *ch, uchar cmd, uchar byte1, uchar byte2,
 	/*
 	 * Check if board is still alive.
 	 */
-	if (ch->ch_bd->state == BOARD_FAILED) {
-		DPR_CORE(("%s:%d board is in failed state.\n", __FILE__, __LINE__));
+	if (ch->ch_bd->state == BOARD_FAILED)
 		return;
-	}
 
 	/*
 	 * Make sure the pointers are in range before
@@ -5485,7 +5146,6 @@ static void dgap_cmdb(struct channel_t *ch, uchar cmd, uchar byte1, uchar byte2,
 	 * Forget it if pointers out of range.
 	 */
 	if (head >= (CMDMAX - CMDSTART) || (head & 03)) {
-		DPR_CORE(("%s:%d pointers out of range, failing board!\n", __FILE__, __LINE__));
 		ch->ch_bd->state = BOARD_FAILED;
 		return;
 	}
@@ -5519,7 +5179,6 @@ static void dgap_cmdb(struct channel_t *ch, uchar cmd, uchar byte1, uchar byte2,
 			break;
 
 		if (--count == 0) {
-			DPR_CORE(("%s:%d failing board.\n",__FILE__, __LINE__));
 			ch->ch_bd->state = BOARD_FAILED;
 			return;
 		}
@@ -5554,10 +5213,8 @@ static void dgap_cmdw(struct channel_t *ch, uchar cmd, u16 word, uint ncmds)
 	/*
 	 * Check if board is still alive.
 	 */
-	if (ch->ch_bd->state == BOARD_FAILED) {
-		DPR_CORE(("%s:%d board is failed!\n", __FILE__, __LINE__));
+	if (ch->ch_bd->state == BOARD_FAILED)
 		return;
-	}
 
 	/*
 	 * Make sure the pointers are in range before
@@ -5574,7 +5231,6 @@ static void dgap_cmdw(struct channel_t *ch, uchar cmd, u16 word, uint ncmds)
 	 * Forget it if pointers out of range.
 	 */
 	if (head >= (CMDMAX - CMDSTART) || (head & 03)) {
-		DPR_CORE(("%s:%d Pointers out of range.  Failing board.\n",__FILE__, __LINE__));
 		ch->ch_bd->state = BOARD_FAILED;
 		return;
 	}
@@ -5607,7 +5263,6 @@ static void dgap_cmdw(struct channel_t *ch, uchar cmd, u16 word, uint ncmds)
 			break;
 
 		if (--count == 0) {
-			DPR_CORE(("%s:%d Failing board.\n",__FILE__, __LINE__));
 			ch->ch_bd->state = BOARD_FAILED;
 			return;
 		}
@@ -5643,10 +5298,8 @@ static void dgap_cmdw_ext(struct channel_t *ch, u16 cmd, u16 word, uint ncmds)
 	/*
 	 * Check if board is still alive.
 	 */
-	if (ch->ch_bd->state == BOARD_FAILED) {
-		DPR_CORE(("%s:%d board is failed!\n", __FILE__, __LINE__));
+	if (ch->ch_bd->state == BOARD_FAILED)
 		return;
-	}
 
 	/*
 	 * Make sure the pointers are in range before
@@ -5663,7 +5316,6 @@ static void dgap_cmdw_ext(struct channel_t *ch, u16 cmd, u16 word, uint ncmds)
 	 * Forget it if pointers out of range.
 	 */
 	if (head >= (CMDMAX - CMDSTART) || (head & 03)) {
-		DPR_CORE(("%s:%d Pointers out of range.  Failing board.\n",__FILE__, __LINE__));
 		ch->ch_bd->state = BOARD_FAILED;
 		return;
 	}
@@ -5709,7 +5361,6 @@ static void dgap_cmdw_ext(struct channel_t *ch, u16 cmd, u16 word, uint ncmds)
 			break;
 
 		if (--count == 0) {
-			DPR_CORE(("%s:%d Failing board.\n",__FILE__, __LINE__));
 			ch->ch_bd->state = BOARD_FAILED;
 			return;
 		}
@@ -5747,7 +5398,6 @@ static void dgap_wmove(struct channel_t *ch, char *buf, uint cnt)
 	 * If pointers are out of range, just return.
 	 */
 	if ((cnt > ch->ch_tsize) || (unsigned)(head - ch->ch_tstart) >= ch->ch_tsize) {
-		DPR_CORE(("%s:%d pointer out of range", __FILE__, __LINE__));
 		return;
 	}
 
@@ -5882,9 +5532,6 @@ static int dgap_param(struct tty_struct *tty)
 	if (!bs)
 		return -ENXIO;
 
-	DPR_PARAM(("param start: tdev: %x cflags: %x oflags: %x iflags: %x\n",
-		ch->ch_tun.un_dev, ch->ch_c_cflag, ch->ch_c_oflag, ch->ch_c_iflag));
-
 	ts = &tty->termios;
 
 	/*
@@ -5912,8 +5559,6 @@ static int dgap_param(struct tty_struct *tty)
 		 * Tell the fep to do the command
 		 */
 
-		DPR_PARAM(("param: Want %d speed\n", ch->ch_custom_speed));
-
 		dgap_cmdw_ext(ch, 0xff01, ch->ch_custom_speed, 0);
 
 		/*
@@ -5922,8 +5567,6 @@ static int dgap_param(struct tty_struct *tty)
 		 */
 		ch->ch_baud_info = ch->ch_custom_speed = dgap_get_custom_baud(ch);
 
-		DPR_PARAM(("param: Got %d speed\n", ch->ch_custom_speed));
-
 		/* Handle transition from B0 */
 		if (ch->ch_flags & CH_BAUD0) {
 			ch->ch_flags &= ~(CH_BAUD0);
@@ -5980,11 +5623,8 @@ static int dgap_param(struct tty_struct *tty)
 
 		if ((iindex >= 0) && (iindex < 4) && (jindex >= 0) && (jindex < 16)) {
 			baud = bauds[iindex][jindex];
-		} else {
-			DPR_IOCTL(("baud indices were out of range (%d)(%d)",
-				iindex, jindex));
+		} else
 			baud = 0;
-		}
 
 		if (baud == 0)
 			baud = 9600;
@@ -6146,14 +5786,10 @@ static int dgap_param(struct tty_struct *tty)
 
 	mval ^= ch->ch_mforce & (mval ^ ch->ch_mval);
 
-	DPR_PARAM(("dgap_param: mval: %x ch_mforce: %x ch_mval: %x ch_mostat: %x\n",
-		mval, ch->ch_mforce, ch->ch_mval, ch->ch_mostat));
-
 	if (ch->ch_mostat ^ mval) {
 		ch->ch_mostat = mval;
 
 		/* Okay to have channel and board locks held calling this */
-		DPR_PARAM(("dgap_param: Sending SMODEM mval: %x\n", mval));
 		dgap_cmdb(ch, SMODEM, (uchar) mval, D_RTS(ch)|D_DTR(ch), 0);
 	}
 
@@ -6185,8 +5821,6 @@ static int dgap_param(struct tty_struct *tty)
 		dgap_cmdb(ch, SAFLOWC, ch->ch_fepastartc, ch->ch_fepastopc, 0);
 	}
 
-	DPR_PARAM(("param finish\n"));
-
 	return 0;
 }
 
@@ -6208,8 +5842,6 @@ static void dgap_parity_scan(struct channel_t *ch, unsigned char *cbuf, unsigned
 	cout = cbuf;
 	fout = fbuf;
 
-	DPR_PSCAN(("dgap_parity_scan start\n"));
-
 	if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
 		return;
 
@@ -6255,26 +5887,20 @@ static void dgap_parity_scan(struct channel_t *ch, unsigned char *cbuf, unsigned
 			if (ch->pscan_savechar == 0x0) {
 
 				if (c == 0x0) {
-					DPR_PSCAN(("dgap_parity_scan in 3rd char of ff seq. c: %x setting break.\n", c));
 					ch->ch_err_break++;
 					*fout++ = TTY_BREAK;
 				}
 				else {
-					DPR_PSCAN(("dgap_parity_scan in 3rd char of ff seq. c: %x setting parity.\n", c));
 					ch->ch_err_parity++;
 					*fout++ = TTY_PARITY;
 				}
 			}
-			else {
-				DPR_PSCAN(("%s:%d Logic Error.\n", __FILE__, __LINE__));
-			}
 
 			count += 1;
 			ch->pscan_state = 0;
 		}
 	}
 	*len = count;
-	DPR_PSCAN(("dgap_parity_scan finish\n"));
 }
 
 
@@ -6327,7 +5953,6 @@ static int dgap_event(struct board_t *bd)
 
 	if (head >= EVMAX - EVSTART || tail >= EVMAX - EVSTART ||
 	    (head | tail) & 03) {
-		DPR_EVENT(("should be calling xxfail %d\n", __LINE__));
 		/* Let go of board lock */
 		DGAP_UNLOCK(bd->bd_lock, lock_flags);
 		return -ENXIO;
@@ -6349,9 +5974,6 @@ static int dgap_event(struct board_t *bd)
 		modem  = event[2];
 		b1     = event[3];
 
-		DPR_EVENT(("event: jiffies: %ld port: %d reason: %x modem: %x\n",
-			jiffies, port, reason, modem));
-
 		/*
 		 * Make sure the interrupt is valid.
 		 */
@@ -6424,8 +6046,6 @@ static int dgap_event(struct board_t *bd)
 		 */
 		if (reason & IFBREAK) {
 
-			DPR_EVENT(("got IFBREAK\n"));
-
 			if (ch->ch_tun.un_tty) {
 				/* A break has been indicated */
 				ch->ch_err_break++;
@@ -6440,8 +6060,6 @@ static int dgap_event(struct board_t *bd)
 		 */
 		if (reason & IFTLW) {
 
-			DPR_EVENT(("event: got low event\n"));
-
 			if (ch->ch_tun.un_flags & UN_LOW) {
 				ch->ch_tun.un_flags &= ~UN_LOW;
 
@@ -6458,8 +6076,6 @@ static int dgap_event(struct board_t *bd)
 					}
 					wake_up_interruptible(&ch->ch_tun.un_tty->write_wait);
 					wake_up_interruptible(&ch->ch_tun.un_flags_wait);
-
-					DPR_EVENT(("event: Got low event. jiffies: %lu\n", jiffies));
 				}
 			}
 
@@ -6491,8 +6107,6 @@ static int dgap_event(struct board_t *bd)
 		 * Process Transmit empty.
 		 */
 		if (reason & IFTEM) {
-			DPR_EVENT(("event: got empty event\n"));
-
 			if (ch->ch_tun.un_flags & UN_EMPTY) {
 				ch->ch_tun.un_flags &= ~UN_EMPTY;
 				if (ch->ch_tun.un_flags & UN_ISOPEN) {
@@ -6583,20 +6197,6 @@ static ssize_t dgap_driver_state_show(struct device_driver *ddp, char *buf)
 }
 static DRIVER_ATTR(state, S_IRUSR, dgap_driver_state_show, NULL);
 
-
-static ssize_t dgap_driver_debug_show(struct device_driver *ddp, char *buf)
-{
-	return snprintf(buf, PAGE_SIZE, "0x%x\n", dgap_debug);
-}
-
-static ssize_t dgap_driver_debug_store(struct device_driver *ddp, const char *buf, size_t count)
-{
-	sscanf(buf, "0x%x\n", &dgap_debug);
-	return count;
-}
-static DRIVER_ATTR(debug, (S_IRUSR | S_IWUSR), dgap_driver_debug_show, dgap_driver_debug_store);
-
-
 static ssize_t dgap_driver_rawreadok_show(struct device_driver *ddp, char *buf)
 {
 	return snprintf(buf, PAGE_SIZE, "0x%x\n", dgap_rawreadok);
@@ -6631,7 +6231,6 @@ static void dgap_create_driver_sysfiles(struct pci_driver *dgap_driver)
 	rc |= driver_create_file(driverfs, &driver_attr_version);
 	rc |= driver_create_file(driverfs, &driver_attr_boards);
 	rc |= driver_create_file(driverfs, &driver_attr_maxboards);
-	rc |= driver_create_file(driverfs, &driver_attr_debug);
 	rc |= driver_create_file(driverfs, &driver_attr_rawreadok);
 	rc |= driver_create_file(driverfs, &driver_attr_pollrate);
 	rc |= driver_create_file(driverfs, &driver_attr_pollcounter);
@@ -6648,7 +6247,6 @@ static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
 	driver_remove_file(driverfs, &driver_attr_version);
 	driver_remove_file(driverfs, &driver_attr_boards);
 	driver_remove_file(driverfs, &driver_attr_maxboards);
-	driver_remove_file(driverfs, &driver_attr_debug);
 	driver_remove_file(driverfs, &driver_attr_rawreadok);
 	driver_remove_file(driverfs, &driver_attr_pollrate);
 	driver_remove_file(driverfs, &driver_attr_pollcounter);
@@ -7361,7 +6959,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			}
 			p->u.board.type = APORT2_920P;
 			p->u.board.v_type = 1;
-			DPR_INIT(("Adding Digi_2r_920 PCI to config...\n"));
 			break;
 
 		case APORT4_920P:	/* AccelePort_4 */
@@ -7371,7 +6968,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			}
 			p->u.board.type = APORT4_920P;
 			p->u.board.v_type = 1;
-			DPR_INIT(("Adding Digi_4r_920 PCI to config...\n"));
 			break;
 
 		case APORT8_920P:	/* AccelePort_8 */
@@ -7381,7 +6977,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			}
 			p->u.board.type = APORT8_920P;
 			p->u.board.v_type = 1;
-			DPR_INIT(("Adding Digi_8r_920 PCI to config...\n"));
 			break;
 
 		case PAPORT4:	/* AccelePort_4 PCI */
@@ -7391,7 +6986,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			}
 			p->u.board.type = PAPORT4;
 			p->u.board.v_type = 1;
-			DPR_INIT(("Adding Digi_4r PCI to config...\n"));
 			break;
 
 		case PAPORT8:	/* AccelePort_8 PCI */
@@ -7401,7 +6995,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			}
 			p->u.board.type = PAPORT8;
 			p->u.board.v_type = 1;
-			DPR_INIT(("Adding Digi_8r PCI to config...\n"));
 			break;
 
 		case PCX:	/* PCI C/X */
@@ -7415,7 +7008,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			p->u.board.conc2 = 0;
 			p->u.board.module1 = 0;
 			p->u.board.module2 = 0;
-			DPR_INIT(("Adding PCI C/X to config...\n"));
 			break;
 
 		case PEPC:	/* PCI EPC/X */
@@ -7429,7 +7021,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			p->u.board.conc2 = 0;
 			p->u.board.module1 = 0;
 			p->u.board.module2 = 0;
-			DPR_INIT(("Adding PCI EPC/X to config...\n"));
 			break;
 
 		case PPCM:	/* PCI/Xem */
@@ -7441,7 +7032,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			p->u.board.v_type = 1;
 			p->u.board.conc1 = 0;
 			p->u.board.conc2 = 0;
-			DPR_INIT(("Adding PCI XEM to config...\n"));
 			break;
 
 		case IO:	/* i/o port */
@@ -7461,7 +7051,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				return(-1);
 			}
 			p->u.board.v_port = 1;
-			DPR_INIT(("Adding IO (%s) to config...\n", s));
 			break;
 
 		case MEM:	/* memory address */
@@ -7481,7 +7070,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				return(-1);
 			}
 			p->u.board.v_addr = 1;
-			DPR_INIT(("Adding MEM (%s) to config...\n", s));
 			break;
 
 		case PCIINFO:	/* pci information */
@@ -7513,9 +7101,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				return(-1);
 			}
 			p->u.board.v_pcislot = 1;
-
-			DPR_INIT(("Adding PCIINFO (%s %s) to config...\n", p->u.board.pcibusstr,
-				p->u.board.pcislotstr));
 			break;
 
 		case METHOD:
@@ -7530,7 +7115,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			}
 			p->u.board.method = dgap_savestring(s);
 			p->u.board.v_method = 1;
-			DPR_INIT(("Adding METHOD (%s) to config...\n", s));
 			break;
 
 		case STATUS:
@@ -7544,7 +7128,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				return(-1);
 			}
 			p->u.board.status = dgap_savestring(s);
-			DPR_INIT(("Adding STATUS (%s) to config...\n", s));
 			break;
 
 		case NPORTS:	/* number of ports */
@@ -7588,7 +7171,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("nports only valid for concentrators or modules");
 				return(-1);
 			}
-			DPR_INIT(("Adding NPORTS (%s) to config...\n", s));
 			break;
 
 		case ID:	/* letter ID used in tty name */
@@ -7610,7 +7192,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("id only valid for concentrators or modules");
 				return(-1);
 			}
-			DPR_INIT(("Adding ID (%s) to config...\n", s));
 			break;
 
 		case STARTO:	/* start offset of ID */
@@ -7654,7 +7235,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("start only valid for concentrators or modules");
 				return(-1);
 			}
-			DPR_INIT(("Adding START (%s) to config...\n", s));
 			break;
 
 		case TTYN:	/* tty name prefix */
@@ -7673,7 +7253,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("out of memory");
 				return(-1);
 			}
-			DPR_INIT(("Adding TTY (%s) to config...\n", s));
 			break;
 
 		case CU:	/* cu name prefix */
@@ -7692,7 +7271,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("out of memory");
 				return(-1);
 			}
-			DPR_INIT(("Adding CU (%s) to config...\n", s));
 			break;
 
 		case LINE:	/* line information */
@@ -7715,7 +7293,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			conc = NULL;
 			line = p;
 			linecnt++;
-			DPR_INIT(("Adding LINE to config...\n"));
 			break;
 
 		case CONC:	/* concentrator information */
@@ -7736,7 +7313,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			else
 				brd->u.board.conc1++;
 
-			DPR_INIT(("Adding CONC to config...\n"));
 			break;
 
 		case CX:	/* c/x type concentrator */
@@ -7746,7 +7322,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			}
 			p->u.conc.type = CX;
 			p->u.conc.v_type = 1;
-			DPR_INIT(("Adding CX to config...\n"));
 			break;
 
 		case EPC:	/* epc type concentrator */
@@ -7756,7 +7331,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			}
 			p->u.conc.type = EPC;
 			p->u.conc.v_type = 1;
-			DPR_INIT(("Adding EPC to config...\n"));
 			break;
 
 		case MOD:	/* EBI module */
@@ -7786,7 +7360,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			else
 				brd->u.board.module1++;
 
-			DPR_INIT(("Adding MOD to config...\n"));
 			break;
 
 		case PORTS:	/* ports type EBI module */
@@ -7796,7 +7369,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			}
 			p->u.module.type = PORTS;
 			p->u.module.v_type = 1;
-			DPR_INIT(("Adding PORTS to config...\n"));
 			break;
 
 		case MODEM:	/* ports type EBI module */
@@ -7806,7 +7378,6 @@ static int	dgap_parsefile(char **in, int Remove)
 			}
 			p->u.module.type = MODEM;
 			p->u.module.v_type = 1;
-			DPR_INIT(("Adding MODEM to config...\n"));
 			break;
 
 		case CABLE:
@@ -7818,7 +7389,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				p->u.line.cable = dgap_savestring(s);
 				p->u.line.v_cable = 1;
 			}
-			DPR_INIT(("Adding CABLE (%s) to config...\n", s));
 			break;
 
 		case SPEED:	/* sync line speed indication */
@@ -7850,7 +7420,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("speed valid only for lines or concentrators.");
 				return(-1);
 			}
-			DPR_INIT(("Adding SPEED (%s) to config...\n", s));
 			break;
 
 		case CONNECT:
@@ -7862,7 +7431,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				p->u.conc.connect = dgap_savestring(s);
 				p->u.conc.v_connect = 1;
 			}
-			DPR_INIT(("Adding CONNECT (%s) to config...\n", s));
 			break;
 		case PRINT:	/* transparent print name prefix */
 			if (dgap_checknode(p))
@@ -7880,7 +7448,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("out of memory");
 				return(-1);
 			}
-			DPR_INIT(("Adding PRINT (%s) to config...\n", s));
 			break;
 
 		case CMAJOR:	/* major number */
@@ -7901,7 +7468,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("bad number for major number");
 				return(-1);
 			}
-			DPR_INIT(("Adding CMAJOR (%s) to config...\n", s));
 			break;
 
 		case ALTPIN:	/* altpin setting */
@@ -7922,7 +7488,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("bad number for altpin");
 				return(-1);
 			}
-			DPR_INIT(("Adding ALTPIN (%s) to config...\n", s));
 			break;
 
 		case USEINTR:		/* enable interrupt setting */
@@ -7943,7 +7508,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("bad number for useintr");
 				return(-1);
 			}
-			DPR_INIT(("Adding USEINTR (%s) to config...\n", s));
 			break;
 
 		case TTSIZ:	/* size of tty structure */
@@ -7964,7 +7528,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("bad number for ttysize");
 				return(-1);
 			}
-			DPR_INIT(("Adding TTSIZ (%s) to config...\n", s));
 			break;
 
 		case CHSIZ:	/* channel structure size */
@@ -7985,7 +7548,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("bad number for chsize");
 				return(-1);
 			}
-			DPR_INIT(("Adding CHSIZE (%s) to config...\n", s));
 			break;
 
 		case BSSIZ:	/* board structure size */
@@ -8006,7 +7568,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("bad number for bssize");
 				return(-1);
 			}
-			DPR_INIT(("Adding BSSIZ (%s) to config...\n", s));
 			break;
 
 		case UNTSIZ:	/* sched structure size */
@@ -8027,7 +7588,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("bad number for schedsize");
 				return(-1);
 			}
-			DPR_INIT(("Adding UNTSIZ (%s) to config...\n", s));
 			break;
 
 		case F2SIZ:	/* f2200 structure size */
@@ -8048,7 +7608,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("bad number for f2200size");
 				return(-1);
 			}
-			DPR_INIT(("Adding F2SIZ (%s) to config...\n", s));
 			break;
 
 		case VPSIZ:	/* vpix structure size */
@@ -8069,7 +7628,6 @@ static int	dgap_parsefile(char **in, int Remove)
 				dgap_err("bad number for vpixsize");
 				return(-1);
 			}
-			DPR_INIT(("Adding VPSIZ (%s) to config...\n", s));
 			break;
 		}
 	}
@@ -8344,18 +7902,12 @@ static struct cnode *dgap_find_config(int type, int bus, int slot)
 			if (p->u.board.type == type) {
 
 				if (p->u.board.v_pcibus && p->u.board.pcibus != bus) {
-					DPR(("Found matching board, but wrong bus position. System says bus %d, we want bus %ld\n",
-						bus, p->u.board.pcibus));
 					continue;
 				}
 				if (p->u.board.v_pcislot && p->u.board.pcislot != slot) {
-					DPR_INIT(("Found matching board, but wrong slot position. System says slot %d, we want slot %ld\n",
-						slot, p->u.board.pcislot));
 					continue;
 				}
 
-				DPR_INIT(("Matched type in config file\n"));
-
 				found = p;
 				/*
 				 * Keep walking thru the list till we find the next board.
diff --git a/drivers/staging/dgap/dgap.h b/drivers/staging/dgap/dgap.h
index 573aa18..7341d4c 100644
--- a/drivers/staging/dgap/dgap.h
+++ b/drivers/staging/dgap/dgap.h
@@ -170,103 +170,6 @@ typedef unsigned char		uchar;
 /* Size of IO (2MB) */
 #define PCI_IO_SIZE		0x00200000
 
-/*
- * Debugging levels can be set using debug insmod variable
- * They can also be compiled out completely.
- */
-
-#define	DBG_INIT		(dgap_debug & 0x01)
-#define	DBG_BASIC		(dgap_debug & 0x02)
-#define	DBG_CORE		(dgap_debug & 0x04)
-
-#define	DBG_OPEN		(dgap_debug & 0x08)
-#define	DBG_CLOSE		(dgap_debug & 0x10)
-#define	DBG_READ		(dgap_debug & 0x20)
-#define	DBG_WRITE		(dgap_debug & 0x40)
-
-#define	DBG_IOCTL		(dgap_debug & 0x80)
-
-#define	DBG_PROC		(dgap_debug & 0x100)
-#define	DBG_PARAM		(dgap_debug & 0x200)
-#define	DBG_PSCAN		(dgap_debug & 0x400)
-#define	DBG_EVENT		(dgap_debug & 0x800)
-
-#define	DBG_DRAIN		(dgap_debug & 0x1000)
-#define	DBG_CARR		(dgap_debug & 0x2000)
-
-#define	DBG_MGMT		(dgap_debug & 0x4000)
-
-
-#if defined(DGAP_TRACER)
-
-# if defined(TRC_TO_KMEM)
-/* Choose one: */
-#  define TRC_ON_OVERFLOW_WRAP_AROUND
-#  undef  TRC_ON_OVERFLOW_SHIFT_BUFFER
-# endif //TRC_TO_KMEM
-
-# define TRC_MAXMSG		1024
-# define TRC_OVERFLOW		"(OVERFLOW)"
-# define TRC_DTRC		"/usr/bin/dtrc"
-
-#if defined TRC_TO_CONSOLE
-#define PRINTF_TO_CONSOLE(args) { printk(DRVSTR": "); printk args; }
-#else //!defined TRACE_TO_CONSOLE
-#define PRINTF_TO_CONSOLE(args)
-#endif
-
-#if defined TRC_TO_KMEM
-#define PRINTF_TO_KMEM(args) dgap_tracef args
-#else //!defined TRC_TO_KMEM
-#define PRINTF_TO_KMEM(args)
-#endif
-
-#define	TRC(args)	{ PRINTF_TO_KMEM(args); PRINTF_TO_CONSOLE(args) }
-
-# define DPR_INIT(ARGS)		if (DBG_INIT) TRC(ARGS)
-# define DPR_BASIC(ARGS)	if (DBG_BASIC) TRC(ARGS)
-# define DPR_CORE(ARGS)		if (DBG_CORE) TRC(ARGS)
-# define DPR_OPEN(ARGS)		if (DBG_OPEN)  TRC(ARGS)
-# define DPR_CLOSE(ARGS)	if (DBG_CLOSE)  TRC(ARGS)
-# define DPR_READ(ARGS)		if (DBG_READ)  TRC(ARGS)
-# define DPR_WRITE(ARGS)	if (DBG_WRITE) TRC(ARGS)
-# define DPR_IOCTL(ARGS)	if (DBG_IOCTL) TRC(ARGS)
-# define DPR_PROC(ARGS)		if (DBG_PROC)  TRC(ARGS)
-# define DPR_PARAM(ARGS)	if (DBG_PARAM)  TRC(ARGS)
-# define DPR_PSCAN(ARGS)	if (DBG_PSCAN)  TRC(ARGS)
-# define DPR_EVENT(ARGS)	if (DBG_EVENT)  TRC(ARGS)
-# define DPR_DRAIN(ARGS)	if (DBG_DRAIN)  TRC(ARGS)
-# define DPR_CARR(ARGS)		if (DBG_CARR)  TRC(ARGS)
-# define DPR_MGMT(ARGS)		if (DBG_MGMT)  TRC(ARGS)
-
-# define DPR(ARGS)		if (dgap_debug) TRC(ARGS)
-# define P(X)			dgap_tracef(#X "=%p\n", X)
-# define X(X)			dgap_tracef(#X "=%x\n", X)
-
-#else//!defined DGAP_TRACER
-
-#define PRINTF_TO_KMEM(args)
-# define TRC(ARGS)
-# define DPR_INIT(ARGS)
-# define DPR_BASIC(ARGS)
-# define DPR_CORE(ARGS)
-# define DPR_OPEN(ARGS)
-# define DPR_CLOSE(ARGS)
-# define DPR_READ(ARGS)
-# define DPR_WRITE(ARGS)
-# define DPR_IOCTL(ARGS)
-# define DPR_PROC(ARGS)
-# define DPR_PARAM(ARGS)
-# define DPR_PSCAN(ARGS)
-# define DPR_EVENT(ARGS)
-# define DPR_DRAIN(ARGS)
-# define DPR_CARR(ARGS)
-# define DPR_MGMT(ARGS)
-
-# define DPR(args)
-
-#endif//DGAP_TRACER
-
 /* Number of boards we support at once. */
 #define	MAXBOARDS	32
 #define	MAXPORTS	224
-- 
1.8.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux