[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120810083508.GA16251@avionic-0098.mockup.avionic-design.de>
Date: Fri, 10 Aug 2012 10:35:08 +0200
From: Thierry Reding <thierry.reding@...onic-design.de>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Grant Likely <grant.likely@...retlab.ca>,
Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
devicetree-discuss@...ts.ozlabs.org,
Linus Walleij <linus.walleij@...ricsson.com>,
Rob Herring <rob.herring@...xeda.com>,
Wolfram Sang <w.sang@...gutronix.de>,
Russell King - ARM Linux <linux@....linux.org.uk>
Subject: Re: [PATCH v2] gpio: Add Avionic Design N-bit GPIO expander support
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@...onic-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
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists