Subject: Re: IRQs in i2c-mpc.c

From: Benjamin Herrenschmidt <[email-masked]>
Date: Sun, 11 Nov 2007 17:26:20 +1100

On Sat, 2007-11-10 at 17:18 -0600, Kumar Gala wrote:
> On Nov 10, 2007, at 5:16 PM, Jon Smirl wrote:
> 
> > On 11/10/07, Kumar Gala <[email-masked]> wrote:
> >> Looking at the current driver it looks like we could get ride of if
> >> check since the previous code checked the return of  
> >> platform_get_irq().
> >
> > The code was a snippet from the larger patch that is converting i2c
> > from being a platform driver to a of_platform driver.
> >
> > The question is, what to do about a missing IRQ tag in the device tree
> > or a IRQ of zero. What is an error and what should be ignored, etc.
> 
> I think the lack of an IRQ in the device tree should be an error.  If  
> the IRQ value is zero, than its zero.

virq 0 is always illegal so if platform_get_irq() returns 0, it can be
safely treated as an error or the absence of irq, on both powerpc and
x86.

Ben.