Skip to content

Commit 3c9fedf

Browse files
Shubhrajyoti Dattawsakernel
authored andcommitted
i2c: xiic: Correct the datatype for rx_watermark
The message length data type should be u16 as per the i2c_msg structure. Signed-off-by: Shubhrajyoti Datta <[email protected]> Acked-by: Michal Simek <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 3fe2ec5 commit 3c9fedf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/i2c/busses/i2c-xiic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ static int xiic_busy(struct xiic_i2c *i2c)
578578

579579
static void xiic_start_recv(struct xiic_i2c *i2c)
580580
{
581-
u8 rx_watermark;
581+
u16 rx_watermark;
582582
struct i2c_msg *msg = i2c->rx_msg = i2c->tx_msg;
583583

584584
/* Clear and enable Rx full interrupt. */
@@ -593,7 +593,7 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
593593
rx_watermark = msg->len;
594594
if (rx_watermark > IIC_RX_FIFO_DEPTH)
595595
rx_watermark = IIC_RX_FIFO_DEPTH;
596-
xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, rx_watermark - 1);
596+
xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, (u8)(rx_watermark - 1));
597597

598598
if (!(msg->flags & I2C_M_NOSTART))
599599
/* write the address */

0 commit comments

Comments
 (0)