From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: arnd@arndb.de, gregkh@linuxfoundation.org, joel@jms.id.au,
nicolas.ferre@microchip.com, linux@armlinux.org.uk,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2 v3] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking
Date: Sun, 19 Nov 2017 09:38:36 +0100 [thread overview]
Message-ID: <20171119083836.qx7bbnalum5rebj3@piout.net> (raw)
In-Reply-To: <3ce95a4e4eb4476b19868f36cd1f11e4b62b6203.1511065797.git.arvind.yadav.cs@gmail.com>
On 19/11/2017 at 10:04:00 +0530, Arvind Yadav wrote:
> 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>
> ---
> changes in v2 :
> Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid.
> changes in v3:
> Return -ENODEV instead of lpc_snoop->irq.
What about -EPROBE_DEFER?
>
> drivers/misc/aspeed-lpc-snoop.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/aspeed-lpc-snoop.c b/drivers/misc/aspeed-lpc-snoop.c
> index cb78c98..e3be88f 100644
> --- a/drivers/misc/aspeed-lpc-snoop.c
> +++ b/drivers/misc/aspeed-lpc-snoop.c
> @@ -115,7 +115,7 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop,
> int rc;
>
> lpc_snoop->irq = platform_get_irq(pdev, 0);
> - if (!lpc_snoop->irq)
> + if (lpc_snoop->irq <= 0)
> return -ENODEV;
>
> rc = devm_request_irq(dev, lpc_snoop->irq,
> --
> 2.7.4
>
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
prev parent reply other threads:[~2017-11-19 8:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-19 4:34 Arvind Yadav
2017-11-19 4:34 ` [PATCH 2/2 v3] misc: atmel-ssc: " Arvind Yadav
2017-11-19 8:39 ` Alexandre Belloni
2017-11-20 9:08 ` Nicolas Ferre
2017-11-19 8:38 ` Alexandre Belloni [this message]
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=20171119083836.qx7bbnalum5rebj3@piout.net \
--to=alexandre.belloni@free-electrons.com \
--cc=arnd@arndb.de \
--cc=arvind.yadav.cs@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=joel@jms.id.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=nicolas.ferre@microchip.com \
/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®