From owner-svn-src-all@FreeBSD.ORG Fri Jun 18 14:20:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AC2B1065670; Fri, 18 Jun 2010 14:20:54 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 797E78FC14; Fri, 18 Jun 2010 14:20:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5IEKsi5081318; Fri, 18 Jun 2010 14:20:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IEKspQ081316; Fri, 18 Jun 2010 14:20:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006181420.o5IEKspQ081316@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 18 Jun 2010 14:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209301 - head/sys/dev/iicbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 18 Jun 2010 14:20:54 -0000 Author: nwhitehorn Date: Fri Jun 18 14:20:54 2010 New Revision: 209301 URL: http://svn.freebsd.org/changeset/base/209301 Log: Revert changes accidentally committed as part of r209298. Modified: head/sys/dev/iicbus/iiconf.c Modified: head/sys/dev/iicbus/iiconf.c ============================================================================== --- head/sys/dev/iicbus/iiconf.c Fri Jun 18 14:17:45 2010 (r209300) +++ head/sys/dev/iicbus/iiconf.c Fri Jun 18 14:20:54 2010 (r209301) @@ -363,7 +363,7 @@ iicbus_transfer(device_t bus, struct iic int iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) { - int i, error, lenread, lenwrote, nkid, rpstart, addr; + int i, error, lenread, lenwrote, nkid; device_t *children, bus; if ((error = device_get_children(dev, &children, &nkid)) != 0) @@ -373,38 +373,14 @@ iicbus_transfer_gen(device_t dev, struct return (EIO); } bus = children[0]; - rpstart = 0; free(children, M_TEMP); for (i = 0, error = 0; i < nmsgs && error == 0; i++) { - addr = msgs[i].slave; if (msgs[i].flags & IIC_M_RD) - addr |= LSB; + error = iicbus_block_read(bus, msgs[i].slave, + msgs[i].buf, msgs[i].len, &lenread); else - addr &= ~LSB; - - if (!(msgs[i].flags & IIC_M_NOSTART)) { - if (rpstart) - error = iicbus_repeated_start(bus, addr, 0); - else - error = iicbus_start(bus, addr, 0); - } - - if (error) - break; - - if (msgs[i].flags & IIC_M_RD) - error = iicbus_read(bus, msgs[i].buf, msgs[i].len, - &lenread, IIC_LAST_READ, 0); - else - error = iicbus_write(bus, msgs[i].buf, msgs[i].len, - &lenwrote, 0); - - if (!(msgs[i].flags & IIC_M_NOSTOP)) { - rpstart = 0; - iicbus_stop(bus); - } else { - rpstart = 1; /* Next message gets repeated start */ - } + error = iicbus_block_write(bus, msgs[i].slave, + msgs[i].buf, msgs[i].len, &lenwrote); } return (error); }