All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Roberta Dobrescu <roberta.dobrescu@gmail.com>, linux-iio@vger.kernel.org
Cc: daniel.baluta@intel.com, octavian.purdila@intel.com,
	jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net,
	vlad.dogaru@intel.com
Subject: Re: [PATCH] iio: accel: mma9551: Check gpiod_to_irq return value
Date: Mon, 02 Mar 2015 12:18:54 +0100	[thread overview]
Message-ID: <54F4471E.1090705@metafoo.de> (raw)
In-Reply-To: <1425292752-7768-1-git-send-email-roberta.dobrescu@gmail.com>

On 03/02/2015 11:39 AM, Roberta Dobrescu wrote:
> The return value of gpiod_to_irq should be checked before giving
> it to devm_request_threaded_irq in order to not pass an error
> code in case it fails.
>
> Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
> Reviewed-by: Vlad Dogaru <vlad.dogaru@intel.com>
> ---
> gpiod_to_irq also appears in the following drivers:
> 	* drivers/iio/accel/bmc150-accel.c
> 	* drivers/iio/accel/kxcjk-1013.c
> 	* drivers/iio/accel/mma9553.c
> 	* drivers/iio/gyro/bmg160.c
> 	* drivers/iio/imu/kmx61.c
> 	* drivers/iio/proximity/sx9500.c,
>
> something like this:
>
> <code>
> 	ret = gpiod_to_irq(gpio);
>
> 	dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio), ret);
>
> 	return ret;
> </code>

Only slightly related, but why are these drivers even using GPIOs to get the 
IRQs. As far as I can see the GPIOs are not used otherwise in which case 
they should rather request the IRQ directly than going making the detour via 
the GPIO.

- Lars


  reply	other threads:[~2015-03-02 11:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 10:39 [PATCH] iio: accel: mma9551: Check gpiod_to_irq return value Roberta Dobrescu
2015-03-02 11:18 ` Lars-Peter Clausen [this message]
2015-03-07 19:08   ` Jonathan Cameron
2015-03-02 14:09 ` Daniel Baluta
2015-03-02 16:15   ` Uwe Kleine-König
2015-03-03  7:02     ` Vlad Dogaru
2015-03-08 11:03       ` Jonathan Cameron
2015-03-09 12:34         ` Vlad Dogaru
2015-03-09 13:29           ` Jonathan Cameron

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=54F4471E.1090705@metafoo.de \
    --to=lars@metafoo.de \
    --cc=daniel.baluta@intel.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=octavian.purdila@intel.com \
    --cc=pmeerw@pmeerw.net \
    --cc=roberta.dobrescu@gmail.com \
    --cc=vlad.dogaru@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.