Add:
/* This is for x86. Do other architectures use this device? */
#define MAX_IRQ 15
if (pciirq > MAX_IRQ) {
printk ("Warning: Your bios gave your IDE chip IRQ%d which is invalid.\n", pciirq);
pciirq = 0;
}
(Untested code, use at your own risk.)
I suggest using the existing NR_IRQS which should be set correctly for each
architecture.
Leonard