Re: [PATCH 2/2] i2c: viai2c: Fix bug for msg->len is 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 3/11/2024 8:56 AM, Hans Hu wrote:
This is a bug that was accidentally introduced when
adjusting the wmt driver. Now fix it


what exactly is the bug which you are fixing here ?

Signed-off-by: Hans Hu <hanshu-oc@xxxxxxxxxxx>
---
  drivers/i2c/busses/i2c-viai2c-common.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-viai2c-common.c b/drivers/i2c/busses/i2c-viai2c-common.c
index 4c208b3a509e..894d24c6b4d3 100644
--- a/drivers/i2c/busses/i2c-viai2c-common.c
+++ b/drivers/i2c/busses/i2c-viai2c-common.c
@@ -145,7 +145,7 @@ static int viai2c_irq_xfer(struct viai2c *i2c)
  		if (msg->len == 0) {
  			val = VIAI2C_CR_TX_END | VIAI2C_CR_CPU_RDY | VIAI2C_CR_ENABLE;
  			writew(val, base + VIAI2C_REG_CR);
-			return 0;
+			return 1;
Question: Do you really need to do anything when no data is there to transfer ? I am not sure what's the strategy adopted here.
  		}
if ((i2c->xfered_len + 1) == msg->len) {




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux