diff --git a/wbsio_spi.c b/wbsio_spi.c
index e6b94ad..922aff1 100644
--- a/wbsio_spi.c
+++ b/wbsio_spi.c
@@ -22,17 +22,6 @@
 #include "flash.h"
 #include "spi.h"
 
-/* Change this to #define if you want lowlevel debugging of commands
- * sent to the Winbond W836xx SPI controller.
- */
-#undef COMM_DEBUG
-
-#ifdef COMM_DEBUG
-#define msg_comm_debug printf_debug
-#else
-#define msg_comm_debug(...) do {} while (0)
-#endif
-
 #define WBSIO_PORT1	0x2e
 #define WBSIO_PORT2	0x4e
 
@@ -46,18 +35,18 @@
 	w836xx_ext_enter(port);
 	id = sio_read(port, 0x20);
 	if (id != 0xa0) {
-		fprintf(stderr, "\nW83627 not found at 0x%x, id=0x%02x want=0xa0.\n", port, id);
+		msg_perr("\nW83627 not found at 0x%x, id=0x%02x want=0xa0.\n", port, id);
 		goto done;
 	}
 
 	if (0 == (sio_read(port, 0x24) & 2)) {
-		fprintf(stderr, "\nW83627 found at 0x%x, but SPI pins are not enabled. (CR[0x24] bit 1=0)\n", port);
+		msg_perr("\nW83627 found at 0x%x, but SPI pins are not enabled. (CR[0x24] bit 1=0)\n", port);
 		goto done;
 	}
 
 	sio_write(port, 0x07, 0x06);
 	if (0 == (sio_read(port, 0x30) & 1)) {
-		fprintf(stderr, "\nW83627 found at 0x%x, but SPI is not enabled. (LDN6[0x30] bit 0=0)\n", port);
+		msg_perr("\nW83627 found at 0x%x, but SPI is not enabled. (LDN6[0x30] bit 0=0)\n", port);
 		goto done;
 	}
 
@@ -74,7 +63,7 @@
 		if (0 == (wbsio_spibase = wbsio_get_spibase(WBSIO_PORT2)))
 			return 1;
 
-	msg_comm_debug("\nwbsio_spibase = 0x%x\n", wbsio_spibase);
+	msg_pspew("\nwbsio_spibase = 0x%x\n", wbsio_spibase);
 
 	buses_supported |= CHIP_BUSTYPE_SPI;
 	spi_controller = SPI_CONTROLLER_WBSIO;
@@ -108,42 +97,42 @@
 	int i;
 	uint8_t mode = 0;
 
-	msg_comm_debug("%s:", __func__);
+	msg_pspew("%s:", __func__);
 
 	if (1 == writecnt && 0 == readcnt) {
 		mode = 0x10;
 	} else if (2 == writecnt && 0 == readcnt) {
 		OUTB(writearr[1], wbsio_spibase + 4);
-		msg_comm_debug(" data=0x%02x", writearr[1]);
+		msg_pspew(" data=0x%02x", writearr[1]);
 		mode = 0x20;
 	} else if (1 == writecnt && 2 == readcnt) {
 		mode = 0x30;
 	} else if (4 == writecnt && 0 == readcnt) {
-		msg_comm_debug(" addr=0x%02x", (writearr[1] & 0x0f));
+		msg_pspew(" addr=0x%02x", (writearr[1] & 0x0f));
 		for (i = 2; i < writecnt; i++) {
 			OUTB(writearr[i], wbsio_spibase + i);
-			msg_comm_debug("%02x", writearr[i]);
+			msg_pspew("%02x", writearr[i]);
 		}
 		mode = 0x40 | (writearr[1] & 0x0f);
 	} else if (5 == writecnt && 0 == readcnt) {
-		msg_comm_debug(" addr=0x%02x", (writearr[1] & 0x0f));
+		msg_pspew(" addr=0x%02x", (writearr[1] & 0x0f));
 		for (i = 2; i < 4; i++) {
 			OUTB(writearr[i], wbsio_spibase + i);
-			msg_comm_debug("%02x", writearr[i]);
+			msg_pspew("%02x", writearr[i]);
 		}
 		OUTB(writearr[i], wbsio_spibase + i);
-		msg_comm_debug(" data=0x%02x", writearr[i]);
+		msg_pspew(" data=0x%02x", writearr[i]);
 		mode = 0x50 | (writearr[1] & 0x0f);
 	} else if (8 == writecnt && 0 == readcnt) {
-		msg_comm_debug(" addr=0x%02x", (writearr[1] & 0x0f));
+		msg_pspew(" addr=0x%02x", (writearr[1] & 0x0f));
 		for (i = 2; i < 4; i++) {
 			OUTB(writearr[i], wbsio_spibase + i);
-			msg_comm_debug("%02x", writearr[i]);
+			msg_pspew("%02x", writearr[i]);
 		}
-		msg_comm_debug(" data=0x");
+		msg_pspew(" data=0x");
 		for (; i < writecnt; i++) {
 			OUTB(writearr[i], wbsio_spibase + i);
-			msg_comm_debug("%02x", writearr[i]);
+			msg_pspew("%02x", writearr[i]);
 		}
 		mode = 0x60 | (writearr[1] & 0x0f);
 	} else if (5 == writecnt && 4 == readcnt) {
@@ -154,17 +143,17 @@
 		 */
 		;
 	} else if (4 == writecnt && readcnt >= 1 && readcnt <= 4) {
-		msg_comm_debug(" addr=0x%02x", (writearr[1] & 0x0f));
+		msg_pspew(" addr=0x%02x", (writearr[1] & 0x0f));
 		for (i = 2; i < writecnt; i++) {
 			OUTB(writearr[i], wbsio_spibase + i);
-			msg_comm_debug("%02x", writearr[i]);
+			msg_pspew("%02x", writearr[i]);
 		}
 		mode = ((7 + readcnt) << 4) | (writearr[1] & 0x0f);
 	}
-	msg_comm_debug(" cmd=%02x mode=%02x\n", writearr[0], mode);
+	msg_pspew(" cmd=%02x mode=%02x\n", writearr[0], mode);
 
 	if (!mode) {
-		fprintf(stderr, "%s: unsupported command type wr=%d rd=%d\n",
+		msg_perr("%s: unsupported command type wr=%d rd=%d\n",
 			__func__, writecnt, readcnt);
 		/* Command type refers to the number of bytes read/written. */
 		return SPI_INVALID_LENGTH;
@@ -177,12 +166,12 @@
 	if (!readcnt)
 		return 0;
 
-	msg_comm_debug("%s: returning data =", __func__);
+	msg_pspew("%s: returning data =", __func__);
 	for (i = 0; i < readcnt; i++) {
 		readarr[i] = INB(wbsio_spibase + 4 + i);
-		msg_comm_debug(" 0x%02x", readarr[i]);
+		msg_pspew(" 0x%02x", readarr[i]);
 	}
-	msg_comm_debug("\n");
+	msg_pspew("\n");
 	return 0;
 }
 
@@ -191,7 +180,7 @@
 	int size = flash->total_size * 1024;
 
 	if (size > 1024 * 1024) {
-		fprintf(stderr, "%s: Winbond saved on 4 register bits so max chip size is 1024 KB!\n", __func__);
+		msg_perr("%s: Winbond saved on 4 register bits so max chip size is 1024 KB!\n", __func__);
 		return 1;
 	}
 
@@ -203,7 +192,7 @@
 	int size = flash->total_size * 1024;
 
 	if (size > 1024 * 1024) {
-		fprintf(stderr, "%s: Winbond saved on 4 register bits so max chip size is 1024 KB!\n", __func__);
+		msg_perr("%s: Winbond saved on 4 register bits so max chip size is 1024 KB!\n", __func__);
 		return 1;
 	}
 
