public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: lars@metafoo.de, Michael.Hennerich@analog.com, knaack.h@gmx.de,
	pmeerw@pmeerw.net, gregkh@linuxfoundation.org, samuel@sortiz.org,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	devel@driverdev.osuosl.org, netdev@vger.kernel.org
Subject: Re: [PATCH 1/3] iio: trigger: Fix platform_get_irq's error checking
Date: Sat, 2 Dec 2017 12:22:41 +0000	[thread overview]
Message-ID: <20171202122241.54c9d376@archlinux> (raw)
In-Reply-To: <1512056616-21065-2-git-send-email-arvind.yadav.cs@gmail.com>

On Thu, 30 Nov 2017 21:13:34 +0530
Arvind Yadav <arvind.yadav.cs@gmail.com> 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>
Applied to the togreg branch of iio.git.  This is probably just
a theoretical problem as obviously the blackfin trigger only runs
on blackfin boards and I assume they only return 0.

Anyhow, nothing wrong with tidying it up as might possible get
cut and paste to somewhere it does matter in future!

Jonathan

> ---
>  drivers/staging/iio/trigger/iio-trig-bfin-timer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
> index d80dcf8..f389f5c 100644
> --- a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
> +++ b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
> @@ -187,9 +187,9 @@ static int iio_bfin_tmr_trigger_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	st->irq = platform_get_irq(pdev, 0);
> -	if (!st->irq) {
> +	if (st->irq < 0) {
>  		dev_err(&pdev->dev, "No IRQs specified");
> -		return -ENODEV;
> +		return st->irq;
>  	}
>  
>  	ret = iio_bfin_tmr_get_number(st->irq);

  reply	other threads:[~2017-12-02 12:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30 15:43 [PATCH 0/3] Handle return value of platform_get_irq Arvind Yadav
2017-11-30 15:43 ` [PATCH 1/3] iio: trigger: Fix platform_get_irq's error checking Arvind Yadav
2017-12-02 12:22   ` Jonathan Cameron [this message]
2017-11-30 15:43 ` [PATCH 2/3] staging: irda: Handle return value of platform_get_irq Arvind Yadav
2017-11-30 16:41   ` Greg KH
2017-11-30 16:45     ` arvindY
2017-11-30 15:43 ` [PATCH 3/3] staging: irda: Remove unnecessary 'err' initialization Arvind Yadav

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=20171202122241.54c9d376@archlinux \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=arvind.yadav.cs@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=samuel@sortiz.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