Date: Tue, 19 Dec 2006 07:41:51 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 111928 for review Message-ID: <200612190741.kBJ7fpqN056233@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=111928 Change 111928 by imp@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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612190741.kBJ7fpqN056233>