IRQs in i2c-mpc.c

Jon Smirl jonsmirl at
Sun Nov 11 10:44:59 EST 2007

On 11/10/07, Kumar Gala <galak at> wrote:
> On Nov 10, 2007, at 5:16 PM, Jon Smirl wrote:
> > On 11/10/07, Kumar Gala <galak at> 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.

irq_of_parse_and_map() returns NO_IRQ when the irq parameter is missing.

This API appears to be broken. In asm-powerpc/irq.h NO_IRQ is defined
as (0). There is no way to tell an error in the attribute from a valid
attribute selecting interrupt zero.

NO_IRQ used to be (-1).

/* This number is used when no interrupt has been assigned */
#define NO_IRQ                  (0)
#define NO_IRQ                  (-1)

Jon Smirl
jonsmirl at

More information about the Linuxppc-dev mailing list