PERFORCE change 111928 for review
Warner Losh
imp at FreeBSD.org
Mon Dec 18 23:41:53 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=111928
Change 111928 by imp at imp_lighthouse on 2006/12/19 07:41:07
Fix the argument to the read/write block routines so that
iicbus_transfer_gen works again. Sam must not have tried to do
iic things on his avila board since I 'fixed' this before...
Affected files ...
.. //depot/projects/arm/src/sys/dev/iicbus/iiconf.c#5 edit
Differences ...
==== //depot/projects/arm/src/sys/dev/iicbus/iiconf.c#5 (text+ko) ====
@@ -356,13 +356,16 @@
* buffer addresses.
*/
int
-iicbus_transfer_gen(device_t bus, struct iic_msg *msgs, uint32_t nmsgs)
+iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
{
- int i, error, max, lenread, lenwrote;
+ int i, error, lenread, lenwrote, nkid;
+ device_t *children, bus;
- for (i = 0, max = 0; i < nmsgs; i++)
- if (max < msgs[i].len)
- max = msgs[i].len;
+ device_get_children(dev, &children, &nkid);
+ if (nkid != 1)
+ return EIO;
+ bus = children[0];
+ free(children, M_TEMP);
for (i = 0, error = 0; i < nmsgs && error == 0; i++) {
if (msgs[i].flags & IIC_M_RD)
error = iicbus_block_read(bus, msgs[i].slave,
More information about the p4-projects
mailing list