Module Name:    src
Committed By:   jdc
Date:           Mon Jan 20 22:02:32 UTC 2014

Modified Files:
        src/sys/dev/ic: pcf8584.c

Log Message:
Remove the check for (cmdlen > 0) when writing.  When i2cscan sends a
quick_write, the command length is 0, so we were previously returning
success for every address in this case.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/ic/pcf8584.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/ic/pcf8584.c
diff -u src/sys/dev/ic/pcf8584.c:1.10 src/sys/dev/ic/pcf8584.c:1.11
--- src/sys/dev/ic/pcf8584.c:1.10	Sun Sep 15 09:17:28 2013
+++ src/sys/dev/ic/pcf8584.c	Mon Jan 20 22:02:32 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcf8584.c,v 1.10 2013/09/15 09:17:28 martin Exp $	*/
+/*	$NetBSD: pcf8584.c,v 1.11 2014/01/20 22:02:32 jdc Exp $	*/
 /*	$OpenBSD: pcf8584.c,v 1.9 2007/10/20 18:46:21 kettenis Exp $ */
 
 /*
@@ -175,9 +175,8 @@ pcfiic_i2c_exec(void *arg, i2c_op_t op, 
 	if (sc->sc_master)
 		pcfiic_choose_bus(sc, addr >> 7);
 
-	if (cmdlen > 0)
-		if (pcfiic_xmit(sc, addr & 0x7f, cmdbuf, cmdlen) != 0)
-			return (1);
+	if (pcfiic_xmit(sc, addr & 0x7f, cmdbuf, cmdlen) != 0)
+		return (1);
 
 	if (len > 0) {
 		if (I2C_OP_WRITE_P(op))

Reply via email to