mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org,
	Linus Walleij <linus.walleij@stericsson.com>,
	Rob Herring <rob.herring@calxeda.com>,
	Wolfram Sang <w.sang@pengutronix.de>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>
Subject: Re: [PATCH v2] gpio: Add Avionic Design N-bit GPIO expander support
Date: Fri, 10 Aug 2012 10:35:08 +0200	[thread overview]
Message-ID: <20120810083508.GA16251@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <CACRpkdaSk9xBaiSAKCj4Pa2kyyfP178XN53i2Q2+CBFx=RoE0g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1491 bytes --]

On Fri, Aug 10, 2012 at 10:19:02AM +0200, Linus Walleij wrote:
> On Thu, Aug 9, 2012 at 10:20 PM, Thierry Reding
> <thierry.reding@avionic-design.de> wrote:
> > On Sun, Jul 29, 2012 at 07:13:57PM +0200, Linus Walleij wrote:
> >> > +       client->irq = irq_of_parse_and_map(client->dev.of_node, 0);
> >> > +       if (client->irq == NO_IRQ)
> >>
> >> Just if (!client->irq) since NO_IRQ is 0 nowadays.
> >
> > At the risk of seeming pedantic, NO_IRQ is in fact quite often not 0.
> 
> No. A year back, yes, but not anymore. We went to great lengths in the
> ARM architecture to ensure NO_IRQ is *always 0. Russell spent
> a lot of time on this.
> 
> Consult the following article on LWN:
> http://lwn.net/Articles/470820/
> 
> Then grep your gitlog and you'll see we got rid of it from ARM.

Then why is there still the following in arch/arm/include/asm/irq.h?

	/*
	 * Use this value to indicate lack of interrupt
	 * capability
	 */
	#ifndef NO_IRQ
	#define NO_IRQ	((unsigned int)(-1))
	#endif

> If this driver is for some other arch like openrisc I might accept
> it but please reconsider.

There's nothing in the driver that makes it ARM specific, so it could be
used on other platforms just as well. But as I also said in my previous
mail, in this particular case the value for the interrupt comes from the
call to irq_of_parse_and_map(), which will return 0 on failure,
regardless of the architecture, so there is actually no problem.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-08-10  8:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-23 11:59 Thierry Reding
2012-07-29 17:13 ` Linus Walleij
2012-07-29 20:27   ` Arnd Bergmann
2012-07-30  7:47   ` Thierry Reding
2012-07-31 22:03     ` Rob Herring
2012-07-31 23:22       ` Stephen Warren
2012-08-02  6:18       ` Thierry Reding
2012-08-05 10:50     ` Linus Walleij
2012-08-06  5:11       ` Thierry Reding
2012-08-06  6:39         ` Linus Walleij
2012-08-09  6:27       ` Thierry Reding
2012-08-09 20:20   ` Thierry Reding
2012-08-10  8:19     ` Linus Walleij
2012-08-10  8:35       ` Thierry Reding [this message]
2012-08-10  8:41         ` Linus Walleij
2012-08-10  8:48           ` Thierry Reding
2012-08-10  9:15           ` Russell King - ARM Linux

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=20120810083508.GA16251@avionic-0098.mockup.avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=arnd@arndb.de \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=rob.herring@calxeda.com \
    --cc=w.sang@pengutronix.de \
    /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

Powered by JetHome