Module Name:    src
Committed By:   jmcneill
Date:           Fri Aug  5 21:19:23 UTC 2011

Modified Files:
        src/sys/dev/i2c: cx24227.c

Log Message:
hide debug messages under CX24227_DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/cx24227.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/i2c/cx24227.c
diff -u src/sys/dev/i2c/cx24227.c:1.3 src/sys/dev/i2c/cx24227.c:1.4
--- src/sys/dev/i2c/cx24227.c:1.3	Fri Aug  5 20:32:22 2011
+++ src/sys/dev/i2c/cx24227.c	Fri Aug  5 21:19:23 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cx24227.c,v 1.3 2011/08/05 20:32:22 jmcneill Exp $ */
+/* $NetBSD: cx24227.c,v 1.4 2011/08/05 21:19:23 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2008, 2011 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cx24227.c,v 1.3 2011/08/05 20:32:22 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cx24227.c,v 1.4 2011/08/05 21:19:23 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -37,6 +37,8 @@
 
 #include <dev/i2c/cx24227var.h>
 
+/* #define CX24227_DEBUG */
+
 struct cx24227 {
 	device_t        parent;
 	i2c_tag_t       tag;
@@ -171,8 +173,6 @@
 int
 cx24227_set_modulation(struct cx24227 *sc, fe_modulation_t modulation)
 {
-	printf("%s\n", __func__);
-
 	switch (modulation) {
 	case VSB_8:
 	case QAM_64:
@@ -244,19 +244,21 @@
 	/* read chip ids */
 	value = 0;
 	e = cx24227_readreg(sc, 0x04, &value);
-	printf("%s chipid %04x\n", __func__, value);
-
 	if (e) {
-		printf("%s read failed %d\n", __func__, e);
+		device_printf(parent, "cx24227: read failed: %d\n", e);
 		kmem_free(sc, sizeof(*sc));
 		return NULL;
 	}
+#ifdef CX24227_DEBUG
+	device_printf(parent, "cx24227: chipid %04x\n", value);
+#endif
+
 
 	value = 0x0001; /* open the i2c gate */
 	e = cx24227_writereg(sc, 0xf3, value);
 #if 0
 	if (e) {
-		printf("%s write failed %d\n", __func__, e);
+		device_printf(parent, "cx24227: write failed: %d\n", e);
 		kmem_free(sc, sizeof(*sc));
 		return NULL;
 	}

Reply via email to