From: Miaoqian Lin <linmq006@gmail.com>
To: Lee Jones <lee.jones@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alessandro Gardich <gremlin@gremlin.it>,
Dmitry Artamonow <mad_soft@inbox.ru>,
Linus Walleij <linus.walleij@linaro.org>,
linux-kernel@vger.kernel.org
Cc: linmq006@gmail.com
Subject: [PATCH] mfd: ipaq-micro: Fix IRQ check in micro_probe
Date: Fri, 14 Jan 2022 06:59:49 +0000 [thread overview]
Message-ID: <20220114065949.24126-1-linmq006@gmail.com> (raw)
platform_get_irq() returns negative error number instead 0 on failure.
And the doc of platform_get_irq() provides a usage example:
int irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
Fix the check of return value to catch errors correctly.
Fixes: dcc21cc09e3c ("mfd: Add driver for Atmel Microcontroller on iPaq h3xxx")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
drivers/mfd/ipaq-micro.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c
index e92eeeb67a98..ac042bfd38a8 100644
--- a/drivers/mfd/ipaq-micro.c
+++ b/drivers/mfd/ipaq-micro.c
@@ -403,8 +403,8 @@ static int __init micro_probe(struct platform_device *pdev)
micro_reset_comm(micro);
irq = platform_get_irq(pdev, 0);
- if (!irq)
- return -EINVAL;
+ if (irq < 0)
+ return irq;
ret = devm_request_irq(&pdev->dev, irq, micro_serial_isr,
IRQF_SHARED, "ipaq-micro",
micro);
--
2.17.1
next reply other threads:[~2022-01-14 6:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-14 6:59 Miaoqian Lin [this message]
2022-01-16 12:08 ` Linus Walleij
2022-05-26 1:09 Zheng Yongjun
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=20220114065949.24126-1-linmq006@gmail.com \
--to=linmq006@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=gremlin@gremlin.it \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mad_soft@inbox.ru \
/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
Powered by JetHome