From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: myungjoo.ham@samsung.com, cw00.choi@samsung.com, wens@csie.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] extcon: adc-jack: Fix platform_get_irq's error checking
Date: Thu, 23 Nov 2017 21:25:29 +0530 [thread overview]
Message-ID: <1511452530-16858-2-git-send-email-arvind.yadav.cs@gmail.com> (raw)
In-Reply-To: <1511452530-16858-1-git-send-email-arvind.yadav.cs@gmail.com>
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/extcon/extcon-adc-jack.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c
index 3877d86..1802635 100644
--- a/drivers/extcon/extcon-adc-jack.c
+++ b/drivers/extcon/extcon-adc-jack.c
@@ -144,7 +144,7 @@ static int adc_jack_probe(struct platform_device *pdev)
return err;
data->irq = platform_get_irq(pdev, 0);
- if (!data->irq) {
+ if (data->irq < 0) {
dev_err(&pdev->dev, "platform_get_irq failed\n");
return -ENODEV;
}
--
2.7.4
next prev parent reply other threads:[~2017-11-23 15:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20171123155542epcas3p38259ac96b30879770cf72c83d199815b@epcas3p3.samsung.com>
2017-11-23 15:55 ` [PATCH 0/2] Handle return value and error checking of platform_get_irq Arvind Yadav
2017-11-23 15:55 ` Arvind Yadav [this message]
2017-11-23 15:55 ` [PATCH 2/2] extcon: axp288:: Handle return value " Arvind Yadav
2017-11-24 0:07 ` [PATCH 0/2] Handle return value and error checking " Chanwoo Choi
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=1511452530-16858-2-git-send-email-arvind.yadav.cs@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=cw00.choi@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=wens@csie.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
all inboxes | Powered by JetHome®