On Tuesday 20 November 2012, James Hogan wrote: > On 09/11/12 14:12, Arnd Bergmann wrote: > > On Wednesday 31 October 2012, James Hogan wrote: > > > >> diff --git a/arch/metag/include/asm/irq.h b/arch/metag/include/asm/irq.h > >> new file mode 100644 > >> index 0000000..da24886 > >> --- /dev/null > >> +++ b/arch/metag/include/asm/irq.h > >> +#ifndef HW_IRQS > >> +#define HW_IRQS (HWSTATMETA_OFFSET_MAX + HWSTATEXT_OFFSET_MAX + \ > >> + HWSTATEXT2_OFFSET_MAX + HWSTATEXT4_OFFSET_MAX + \ > >> + HWSTATEXT6_OFFSET_MAX) > >> +#endif > >> + > >> +#define META_IRQS 32 > >> + > >> +#define NR_IRQS (META_IRQS + HW_IRQS) > > > > I think you should use sparse IRQs right from the start and avoid > > hardcoding interrupt numbers from the start. > > I presume core irq numbers need hard coding (e.g. those required by core > code like cross-hardware-thread irqs and perf counters)? Or would the > recommended way be to have a function which is given the core hw irq > number and converts/maps a virtual irq for it using the irq domain? Anything that is probed as a platform device can get the interrupt numbers using the device resources that are filled in by the device tree probe. If you need something earlier, you can call irq_of_parse_and_map() manually. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html