From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 18:04:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4321CC33; Mon, 20 Oct 2014 18:04:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F1151E3; Mon, 20 Oct 2014 18:04:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9KI4LRH014772; Mon, 20 Oct 2014 18:04:21 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9KI4LmG014771; Mon, 20 Oct 2014 18:04:21 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201410201804.s9KI4LmG014771@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 20 Oct 2014 18:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273337 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2014 18:04:21 -0000 Author: loos Date: Mon Oct 20 18:04:20 2014 New Revision: 273337 URL: https://svnweb.freebsd.org/changeset/base/273337 Log: Fix the mtx_sleep() error checking, catch all errors and not only EWOULDBLOCK. Do not print any message at errors. The errors are properly sent to upper layers which should be able to deal with it, including printing the errors when they need to. The error message was quite annoying while scanning the i2c bus. MFC after: 1 week Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Oct 20 18:00:50 2014 (r273336) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Oct 20 18:04:20 2014 (r273337) @@ -441,12 +441,11 @@ bcm_bsc_transfer(device_t dev, struct ii /* Wait for the transaction to complete. */ err = mtx_sleep(dev, &sc->sc_mtx, 0, "bsciow", hz); - /* Check if we have a timeout or an I2C error. */ - if ((sc->sc_flags & BCM_I2C_ERROR) || err == EWOULDBLOCK) { - device_printf(sc->sc_dev, "I2C error\n"); + /* Check for errors. */ + if (err != 0 && (sc->sc_flags & BCM_I2C_ERROR)) err = EIO; + if (err != 0) break; - } } /* Clean the controller flags. */