mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
xilinx_xiic: Fix fill tx fifo loop
Comparison should be against the actual message length, not loop index. len is used for stopping while loop, pos is position in message. stop should be sent when entire message is sent, not when len and pos meet. hs: fixed DOS line endings Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
This commit is contained in:
parent
2d1e879c79
commit
5324e8ef6c
1 changed files with 1 additions and 1 deletions
|
@ -149,7 +149,7 @@ static void xiic_fill_tx_fifo(struct xilinx_xiic_priv *priv,
|
|||
while (len--) {
|
||||
u16 data = msg->buf[pos++];
|
||||
|
||||
if (pos == len && nmsgs == 1) {
|
||||
if ((msg->len - pos == 0) && nmsgs == 1) {
|
||||
/* last message in transfer -> STOP */
|
||||
data |= XIIC_TX_DYN_STOP_MASK;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue