Commit 59851fb0 authored by Daniel Scally's avatar Daniel Scally Committed by Wolfram Sang

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: 8fa9c938 ("i2c: xiic: return value of xiic_reinit")
Signed-off-by: default avatarDaniel Scally <dan.scally@ideasonboard.com>
Acked-by: default avatarMichal Simek <michal.simek@amd.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@kernel.org>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent db6aee60
......@@ -710,7 +710,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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment