mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 2/2 v3] misc: atmel-ssc: Fix platform_get_irq's error checking
Date: Sun, 19 Nov 2017 09:39:32 +0100	[thread overview]
Message-ID: <20171119083932.7qm2dnqqsgrzbim7@piout.net> (raw)
In-Reply-To: <fbe464e8bd8039463c4984835286b19060509f82.1511065797.git.arvind.yadav.cs@gmail.com>

On 19/11/2017 at 10:04:01 +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 ssc->irq.

The patch is not doing what you claim here.


> 
>  drivers/misc/atmel-ssc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
> index b2a0340..2ec0f9e 100644
> --- a/drivers/misc/atmel-ssc.c
> +++ b/drivers/misc/atmel-ssc.c
> @@ -235,7 +235,7 @@ 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;
>  	}
> -- 
> 2.7.4
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2017-11-19  8:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-19  4:34 [PATCH 1/2 v3] misc: aspeed-lpc-snoop: " Arvind Yadav
2017-11-19  4:34 ` [PATCH 2/2 v3] misc: atmel-ssc: " Arvind Yadav
2017-11-19  8:39   ` Alexandre Belloni [this message]
2017-11-20  9:08   ` Nicolas Ferre
2017-11-19  8:38 ` [PATCH 1/2 v3] misc: aspeed-lpc-snoop: " Alexandre Belloni

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=20171119083932.7qm2dnqqsgrzbim7@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®