Skip to content

Commit

Permalink
i2c: xiic: Correct return value check for xiic_reinit()
Browse files Browse the repository at this point in the history
[ Upstream commit 59851fb ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Daniel Scally authored and gregkh committed Oct 6, 2023
1 parent fb9cfb2 commit 70a1df9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-xiic.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
* reset the IP instead of just flush fifos
*/
ret = xiic_reinit(i2c);
if (!ret)
if (ret < 0)
dev_dbg(i2c->adap.dev.parent, "reinit failed\n");

if (i2c->rx_msg) {
Expand Down

0 comments on commit 70a1df9

Please sign in to comment.