i2c: xiic: Correct the datatype for rx_watermark
authorShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Tue, 17 May 2022 05:34:52 +0000 (11:04 +0530)
committerWolfram Sang <wsa@kernel.org>
Sat, 21 May 2022 06:18:20 +0000 (08:18 +0200)
The message length data type should be u16 as per the i2c_msg structure.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-xiic.c

index aa6e37a9f27577ac86b8ac32ee192334e9c06d1c..9a1c3f8b7048dc192842e064ea4ead27daa69c65 100644 (file)
@@ -578,7 +578,7 @@ static int xiic_busy(struct xiic_i2c *i2c)
 
 static void xiic_start_recv(struct xiic_i2c *i2c)
 {
-       u8 rx_watermark;
+       u16 rx_watermark;
        struct i2c_msg *msg = i2c->rx_msg = i2c->tx_msg;
 
        /* Clear and enable Rx full interrupt. */
@@ -593,7 +593,7 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
        rx_watermark = msg->len;
        if (rx_watermark > IIC_RX_FIFO_DEPTH)
                rx_watermark = IIC_RX_FIFO_DEPTH;
-       xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, rx_watermark - 1);
+       xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, (u8)(rx_watermark - 1));
 
        if (!(msg->flags & I2C_M_NOSTART))
                /* write the address */