Date: Fri, 9 Oct 2015 21:27:30 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289083 - head/sys/dev/iicbus Message-ID: <201510092127.t99LRU06012722@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510092127.t99LRU06012722>