PERFORCE change 110646 for review

Warner Losh imp at FreeBSD.org
Tue Nov 28 16:19:20 PST 2006


http://perforce.freebsd.org/chv.cgi?CH=110646

Change 110646 by imp at imp_lighthouse on 2006/11/29 00:18:43

	backout lameness.

Affected files ...

.. //depot/projects/arm/src/sys/arm/at91/at91_twi.c#33 edit

Differences ...

==== //depot/projects/arm/src/sys/arm/at91/at91_twi.c#33 (text+ko) ====

@@ -224,16 +224,11 @@
 {
 	int err = 0;
 	int counter = 100000;
-	uint32_t sr;
 
-	while (!((sr = RD4(sc, TWI_SR)) & bit) && counter-- > 0)
+	while (!(RD4(sc, TWI_SR) & bit) && counter-- > 0)
 		continue;
 	if (counter <= 0)
 		err = EBUSY;
-	else if (sr & TWI_SR_NACK)
-		err = EADDRNOTAVAIL;
-	if (sr & ~bit)
-		printf("status is %x\n", sr);
 	return (err);
 }
 
@@ -336,20 +331,14 @@
 				WR4(sc, TWI_THR, *buf++);
 				if (len == 0)
 					WR4(sc, TWI_CR, TWI_CR_STOP);
-				if ((err = at91_twi_wait(sc, TWI_SR_TXRDY))) {
-					printf("Len %d\n", len);
+				if ((err = at91_twi_wait(sc, TWI_SR_TXRDY)))
 					goto out;
-				}
 			}
 		}
 		if ((err = at91_twi_wait(sc, TWI_SR_TXCOMP)))
 			break;
 	}
 out:;
-	if (err) {
-		WR4(sc, TWI_CR, TWI_CR_STOP);
-		printf("Err is %d\n", err);
-	}
 	AT91_TWI_UNLOCK(sc);
 	return (err);
 }


More information about the p4-projects mailing list