Skip to content

Commit 59851fb

Browse files
djrscallywsakernel
authored andcommitted
i2c: xiic: Correct return value check for xiic_reinit()
The error paths for xiic_reinit() return negative values on failure and 0 on success - this error message therefore is triggered on _success_ rather than failure. Correct the condition so it's only shown on failure as intended. Fixes: 8fa9c93 ("i2c: xiic: return value of xiic_reinit") Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Acked-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent db6aee6 commit 59851fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-xiic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
710710
* reset the IP instead of just flush fifos
711711
*/
712712
ret = xiic_reinit(i2c);
713-
if (!ret)
713+
if (ret < 0)
714714
dev_dbg(i2c->adap.dev.parent, "reinit failed\n");
715715

716716
if (i2c->rx_msg) {

0 commit comments

Comments
 (0)