i2c: viperboard: return message count on master_xfer success
authorPeter Rosin <peda@axentia.se>
Wed, 9 May 2018 19:47:48 +0000 (21:47 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 15 May 2018 07:31:26 +0000 (09:31 +0200)
Returning zero is wrong in this case.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Fixes: 174a13aa8669 ("i2c: Add viperboard i2c master driver")
drivers/i2c/busses/i2c-viperboard.c

index e4be86b3de9a28b201bcd197470ab3a3a78ee683..7235c7302bb7cd000db814ec12de03193a22ef01 100644 (file)
@@ -337,7 +337,7 @@ static int vprbrd_i2c_xfer(struct i2c_adapter *i2c, struct i2c_msg *msgs,
                }
                mutex_unlock(&vb->lock);
        }
-       return 0;
+       return num;
 error:
        mutex_unlock(&vb->lock);
        return error;