linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Krzysztof Kozlowski <krzk@kernel.org>,
	Wolfram Sang <wsa@kernel.org>,
	Andrzej Hajda <a.hajda@samsung.com>
Cc: linux-i2c@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH v2 3/3] i2c: exynos5: don't check for irq 0
Date: Sun,  1 Nov 2020 18:18:07 +0100	[thread overview]
Message-ID: <20201101171807.8182-3-martin@kaiser.cx> (raw)
In-Reply-To: <20201101171807.8182-1-martin@kaiser.cx>

platform_get_irq never returns 0. Don't check for this. Make it clear that
the error path always returns a negative error code.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
changes in v2
- split the patch in three parts

 drivers/i2c/busses/i2c-exynos5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
index fad1c52857aa..20a9881a0d6c 100644
--- a/drivers/i2c/busses/i2c-exynos5.c
+++ b/drivers/i2c/busses/i2c-exynos5.c
@@ -778,7 +778,7 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
 	init_completion(&i2c->msg_complete);
 
 	i2c->irq = ret = platform_get_irq(pdev, 0);
-	if (ret <= 0)
+	if (ret < 0)
 		goto err_clk;
 
 	ret = devm_request_irq(&pdev->dev, i2c->irq, exynos5_i2c_irq,
-- 
2.20.1


  parent reply	other threads:[~2020-11-01 17:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 21:42 [PATCH] i2c: exynos5: fix platform_get_irq error handling Martin Kaiser
2020-10-28  7:21 ` Krzysztof Kozlowski
2020-11-01 17:18 ` [PATCH v2 1/3] i2c: exynos5: remove duplicate error message Martin Kaiser
2020-11-01 17:18   ` [PATCH v2 2/3] i2c: exynos5: fix platform_get_irq error handling Martin Kaiser
2020-11-02  8:39     ` Krzysztof Kozlowski
2020-11-01 17:18   ` Martin Kaiser [this message]
2020-11-02  8:37     ` [PATCH v2 3/3] i2c: exynos5: don't check for irq 0 Krzysztof Kozlowski
2020-11-02  8:37   ` [PATCH v2 1/3] i2c: exynos5: remove duplicate error message Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201101171807.8182-3-martin@kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=a.hajda@samsung.com \
    --cc=krzk@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).