From patchwork Wed Sep 20 13:41:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 13392782 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31C99CE79CE for ; Wed, 20 Sep 2023 13:42:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=hEj2tqwkuqqRBQ6/21UePEtqCeVMaOjSwKLaeLk5+FU=; b=XANoG9z6LN3chP JMgttkoXYjxAR/AkhaNxNJXaSr7z6aA/+p5iezYadeda/N/6gJbDzYkiPtxrWRlsxfuNhQD9gK5mi Ohw9VK0Zg7d1ptKXhld44cx/+ga3JzFbsNO0K+7boEQ10c4I19T0k48xToj5GIVqHAcGdSDAx3A6W 2U+VFQ0rMhrCR7hxDmmJV0bxGTwH3mlJfO6n+yEPMWhFWbb0fPmdMz+PTl07m1TFH83PimhWBcpAX 58JkZ8O9sj8SyiowBGCLYwM5tIZ/wkL27FOlNh74wZclHl/mPSMgmdrfFvd5iuGP932AwYpHX38eu yg0TEZEBypBBnY3tqIqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qixSh-003Cym-1D; Wed, 20 Sep 2023 13:41:51 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qixSe-003Cxx-2q for linux-arm-kernel@lists.infradead.org; Wed, 20 Sep 2023 13:41:50 +0000 Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 09E91B75; Wed, 20 Sep 2023 15:40:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1695217204; bh=4DAnwKdiJcD3tRa/uKhRksrsVpdH55e7eVQWVHpgpNM=; h=From:To:Cc:Subject:Date:From; b=sr1CHmliMZH5G5oiM21cWFiiZXMzbKOZWYSxZ8ruF9+ypUQYKa08UK2QSKn2cfaoj prliP36BKftZ0BK/b/GqFBQKGtd7+dbaOKlXbu0mQiJocFqa6ZM/nhEY/PMNP+/xp1 acw5m5fdb04tnAAh71Cu0ogJtH2d58k1XFR5RV1k= From: Daniel Scally To: Michal Simek , Andi Shyti , Wolfram Sang , Shubhrajyoti Datta , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org Cc: Raviteja Narayanam , Daniel Scally Subject: [PATCH] i2c: xiic: Correct return value check for xiic_reinit() Date: Wed, 20 Sep 2023 14:41:09 +0100 Message-Id: <20230920134109.2232769-1-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230920_064149_082086_10679534 X-CRM114-Status: GOOD ( 12.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 8fa9c9388053 ("i2c: xiic: return value of xiic_reinit") Signed-off-by: Daniel Scally Acked-by: Michal Simek Reviewed-by: Andi Shyti --- drivers/i2c/busses/i2c-xiic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index b3bb97762c85..71391b590ada 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -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) {