From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>, <arnd@arndb.de>,
<gregkh@linuxfoundation.org>, <joel@jms.id.au>,
<alexandre.belloni@free-electrons.com>, <linux@armlinux.org.uk>
Cc: <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2 v2] misc: atmel-ssc: Fix platform_get_irq's error checking
Date: Mon, 20 Nov 2017 10:06:53 +0100 [thread overview]
Message-ID: <fa7e7cbc-1c18-64f8-67eb-505ad5dcbad5@microchip.com> (raw)
In-Reply-To: <03c6f3e9df6d3077717e1f14b4775f2864a0304a.1510995185.git.arvind.yadav.cs@gmail.com>
On 18/11/2017 at 10:10, 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.
>
> drivers/misc/atmel-ssc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
> index b2a0340..9d9eeae 100644
> --- a/drivers/misc/atmel-ssc.c
> +++ b/drivers/misc/atmel-ssc.c
> @@ -235,9 +235,9 @@ static int ssc_probe(struct platform_device *pdev)
> clk_disable_unprepare(ssc->clk);
>
> ssc->irq = platform_get_irq(pdev, 0);
> - if (!ssc->irq) {
> + if (ssc->irq <= 0) {
> dev_dbg(&pdev->dev, "could not get irq\n");
> - return -ENXIO;
> + return ssc->irq;
if ssc->irq = 0, I believe that returning 0 is not the right thing to do.
Regards,
> }
>
> spin_lock(&user_lock);
>
--
Nicolas Ferre
prev parent reply other threads:[~2017-11-20 9:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-18 9:10 [PATCH 1/2 v2] misc: aspeed-lpc-snoop: " Arvind Yadav
2017-11-18 9:10 ` [PATCH 2/2 v2] misc: atmel-ssc: " Arvind Yadav
2017-11-20 9:06 ` Nicolas Ferre [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=fa7e7cbc-1c18-64f8-67eb-505ad5dcbad5@microchip.com \
--to=nicolas.ferre@microchip.com \
--cc=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 \
/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®