From owner-svn-src-all@freebsd.org Fri Oct 9 21:27:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6C909D28E5; Fri, 9 Oct 2015 21:27:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 92DC5C9D; Fri, 9 Oct 2015 21:27:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t99LRUdc012723; Fri, 9 Oct 2015 21:27:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t99LRU06012722; Fri, 9 Oct 2015 21:27:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201510092127.t99LRU06012722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 9 Oct 2015 21:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289083 - head/sys/dev/iicbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2015 21:27:31 -0000 Author: ian Date: Fri Oct 9 21:27:30 2015 New Revision: 289083 URL: https://svnweb.freebsd.org/changeset/base/289083 Log: Style and whitespace cleanups. The only functional change is removal of a printf that appears to be left over from development debugging. Modified: head/sys/dev/iicbus/icee.c Modified: head/sys/dev/iicbus/icee.c ============================================================================== --- head/sys/dev/iicbus/icee.c Fri Oct 9 21:04:28 2015 (r289082) +++ head/sys/dev/iicbus/icee.c Fri Oct 9 21:27:30 2015 (r289083) @@ -84,7 +84,7 @@ static struct cdevsw icee_cdevsw = static int icee_probe(device_t dev) { - /* XXX really probe? -- not until we know the size... */ + device_set_desc(dev, "I2C EEPROM"); return (BUS_PROBE_NOWILDCARD); } @@ -118,7 +118,7 @@ icee_attach(device_t dev) } sc->cdev->si_drv1 = sc; ICEE_LOCK_INIT(sc); -out:; +out: return (err); } @@ -126,7 +126,7 @@ static int icee_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { - return (0); + return (0); } static int @@ -241,18 +241,14 @@ icee_write(struct cdev *dev, struct uio error = iicbus_transfer(sc->sc_dev, wr, 1); if (error) break; - // Now wait for the write to be done by trying to read - // the part. + /* Read after write to wait for write-done. */ waitlimit = 10000; rd[0].slave = slave; - do - { - error = iicbus_transfer(sc->sc_dev, rd, 1); + do { + error = iicbus_transfer(sc->sc_dev, rd, 1); } while (waitlimit-- > 0 && error != 0); - if (error) { - printf("waiting for write failed %d\n", error); - break; - } + if (error) + break; } ICEE_UNLOCK(sc); return error;