From owner-p4-projects@FreeBSD.ORG Wed Nov 29 00:19:20 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3CCC616A407; Wed, 29 Nov 2006 00:19:20 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 14F3016A416 for ; Wed, 29 Nov 2006 00:19:20 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C27D43CA2 for ; Wed, 29 Nov 2006 00:19:02 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kAT0J7Hg027880 for ; Wed, 29 Nov 2006 00:19:07 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kAT0J7If027877 for perforce@freebsd.org; Wed, 29 Nov 2006 00:19:07 GMT (envelope-from imp@freebsd.org) Date: Wed, 29 Nov 2006 00:19:07 GMT Message-Id: <200611290019.kAT0J7If027877@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 110646 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Nov 2006 00:19:20 -0000 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); }