Date: Wed, 29 Nov 2006 00:19:07 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 110646 for review Message-ID: <200611290019.kAT0J7If027877@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=110646 Change 110646 by imp@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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611290019.kAT0J7If027877>