i2c: fix i2c-sh_mobile rx underrun
Fix receive path underrun in i2c-sh_mobile driver. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
@@ -318,7 +318,8 @@ static int sh_mobile_i2c_isr_rx(struct sh_mobile_i2c_data *pd)
|
|||||||
} else
|
} else
|
||||||
data = i2c_op(pd, OP_RX, 0);
|
data = i2c_op(pd, OP_RX, 0);
|
||||||
|
|
||||||
pd->msg->buf[real_pos] = data;
|
if (real_pos >= 0)
|
||||||
|
pd->msg->buf[real_pos] = data;
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
pd->pos++;
|
pd->pos++;
|
||||||
|
Reference in New Issue
Block a user