]> www.infradead.org Git - users/willy/xarray.git/commitdiff
i2c: isch: Add missed 'else'
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 11 Sep 2024 15:39:14 +0000 (18:39 +0300)
committerAndi Shyti <andi.shyti@kernel.org>
Wed, 11 Sep 2024 21:32:24 +0000 (23:32 +0200)
In accordance with the existing comment and code analysis
it is quite likely that there is a missed 'else' when adapter
times out. Add it.

Fixes: 5bc1200852c3 ("i2c: Add Intel SCH SMBus support")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: <stable@vger.kernel.org> # v2.6.27+
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
drivers/i2c/busses/i2c-isch.c

index 33dbc19d3848dd34062bbc9a7cb4000a12ff64c0..f59158489ad9fa0dedb9bb4db8952cfeb676ae47 100644 (file)
@@ -99,8 +99,7 @@ static int sch_transaction(void)
        if (retries > MAX_RETRIES) {
                dev_err(&sch_adapter.dev, "SMBus Timeout!\n");
                result = -ETIMEDOUT;
-       }
-       if (temp & 0x04) {
+       } else if (temp & 0x04) {
                result = -EIO;
                dev_dbg(&sch_adapter.dev, "Bus collision! SMBus may be "
                        "locked until next hard reset. (sorry!)\n");