Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Oct 2015 02:29:02 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r289105 - head/sys/dev/iicbus
Message-ID:  <201510100229.t9A2T2rB002047@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sat Oct 10 02:29:02 2015
New Revision: 289105
URL: https://svnweb.freebsd.org/changeset/base/289105

Log:
  Translate iic hardware layer status values to errno return values.

Modified:
  head/sys/dev/iicbus/icee.c

Modified: head/sys/dev/iicbus/icee.c
==============================================================================
--- head/sys/dev/iicbus/icee.c	Sat Oct 10 02:06:07 2015	(r289104)
+++ head/sys/dev/iicbus/icee.c	Sat Oct 10 02:29:02 2015	(r289105)
@@ -180,8 +180,10 @@ icee_read(struct cdev *dev, struct uio *
 		for (i = 0; i < 2; i++)
 			msgs[i].slave = slave;
 		error = iicbus_transfer(sc->sc_dev, msgs, 2);
-		if (error)
+		if (error) {
+			error = iic2errno(error);
 			break;
+		}
 		error = uiomove(data, len, uio);
 		if (error)
 			break;
@@ -239,16 +241,20 @@ icee_write(struct cdev *dev, struct uio 
 		if (error)
 			break;
 		error = iicbus_transfer(sc->sc_dev, wr, 1);
-		if (error)
+		if (error) {
+			error = iic2errno(error);
 			break;
+		}
 		/* Read after write to wait for write-done. */
 		waitlimit = 10000;
 		rd[0].slave = slave;
 		do {
 			error = iicbus_transfer(sc->sc_dev, rd, 1);
 		} while (waitlimit-- > 0 && error != 0);
-		if (error)
+		if (error) {
+			error = iic2errno(error);
 			break;
+		}
 	}
 	ICEE_UNLOCK(sc);
 	return error;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510100229.t9A2T2rB002047>