public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: <linux-i2c@vger.kernel.org>
Cc: George Cherian <gcherian@marvell.com>
Subject: [PATCH v2 5/5] i2c: xlp9xx: fix main IRQ check
Date: Sun, 4 Jul 2021 17:47:54 +0300	[thread overview]
Message-ID: <88b0915b-de45-1ef3-0b03-ec9c2ff3ce88@omp.ru> (raw)
In-Reply-To: <3712e871-bf2f-32c5-f9c2-2968c42087f8@omp.ru>

Iff platform_get_irq() returns 0 for the main IRQ, the driver's probe()
method will return 0 early (as if the method's call was successful).
Let's consider IRQ0 valid for simplicity -- devm_request_irq() can always
override that decision...

Fixes: 2bbd681ba2b ("i2c: xlp9xx: Driver for Netlogic XLP9XX/5XX I2C controller")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

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

Index: linux/drivers/i2c/busses/i2c-xlp9xx.c
===================================================================
--- linux.orig/drivers/i2c/busses/i2c-xlp9xx.c
+++ linux/drivers/i2c/busses/i2c-xlp9xx.c
@@ -517,7 +517,7 @@ static int xlp9xx_i2c_probe(struct platf
 		return PTR_ERR(priv->base);
 
 	priv->irq = platform_get_irq(pdev, 0);
-	if (priv->irq <= 0)
+	if (priv->irq < 0)
 		return priv->irq;
 	/* SMBAlert irq */
 	priv->alert_data.irq = platform_get_irq(pdev, 1);

  parent reply	other threads:[~2021-07-04 14:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-04 14:32 [PATCH v2 0/5] Correctly handle plaform_get_irq()'s result in the i2C drivers Sergey Shtylyov
2021-07-04 14:35 ` [PATCH v2 1/5] i2c: hix5hd2: fix IRQ check Sergey Shtylyov
2021-08-17 20:10   ` Wolfram Sang
2021-07-04 14:38 ` [PATCH v2 2/5] i2c: mt65xx: " Sergey Shtylyov
2021-08-17 20:09   ` Wolfram Sang
2021-08-20  1:46     ` Qii Wang
2021-08-25 21:00   ` Wolfram Sang
2021-07-04 14:41 ` [PATCH v2 3/5] i2c: pmcmsp: " Sergey Shtylyov
2021-08-17 20:08   ` Wolfram Sang
2021-07-04 14:45 ` [PATCH v2 4/5] i2c: s3c2410: " Sergey Shtylyov
2021-07-05  7:46   ` Krzysztof Kozlowski
2021-08-17 20:08   ` Wolfram Sang
2021-07-04 14:47 ` Sergey Shtylyov [this message]
2021-08-17 20:13   ` [PATCH v2 5/5] i2c: xlp9xx: fix main " Wolfram Sang
2021-08-25 21:05   ` Wolfram Sang
2021-08-11 20:12 ` [PATCH v2 0/5] Correctly handle plaform_get_irq()'s result in the i2C drivers Sergey Shtylyov
2021-08-11 20:14   ` Sergey Shtylyov
  -- strict thread matches above, loose matches on Subject: below --
2021-08-18  3:17 [PATCH v2 5/5] i2c: xlp9xx: fix main IRQ check George Cherian

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=88b0915b-de45-1ef3-0b03-ec9c2ff3ce88@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=gcherian@marvell.com \
    --cc=linux-i2c@vger.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