1
0
Fork 0

powerpc: Remove all usages of NO_IRQ

NO_IRQ has been == 0 on powerpc for just over ten years (since commit
0ebfff1491 ("[POWERPC] Add new interrupt mapping core and change
platforms to use it")). It's also 0 on most other arches.

Although it's fairly harmless, every now and then it causes confusion
when a driver is built on powerpc and another arch which doesn't define
NO_IRQ. There's at least 6 definitions of NO_IRQ in drivers/, at least
some of which are to work around that problem.

So we'd like to remove it. This is fairly trivial in the arch code, we
just convert:

    if (irq == NO_IRQ)	to	if (!irq)
    if (irq != NO_IRQ)	to	if (irq)
    irq = NO_IRQ;	to	irq = 0;
    return NO_IRQ;	to	return 0;

And a few other odd cases as well.

At least for now we keep the #define NO_IRQ, because there is driver
code that uses NO_IRQ and the fixes to remove those will go via other
trees.

Note we also change some occurrences in PPC sound drivers, drivers/ps3,
and drivers/macintosh.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
hifive-unleashed-5.1
Michael Ellerman 2016-09-06 21:53:24 +10:00
parent 9d82fd2fae
commit ef24ba7091
80 changed files with 204 additions and 200 deletions

View File

@ -61,7 +61,7 @@ struct machdep_calls {
void (*init_IRQ)(void); void (*init_IRQ)(void);
/* Return an irq, or NO_IRQ to indicate there are none pending. */ /* Return an irq, or 0 to indicate there are none pending. */
unsigned int (*get_irq)(void); unsigned int (*get_irq)(void);
/* PCI stuff */ /* PCI stuff */

View File

@ -122,9 +122,9 @@ static inline void mpic_msgr_set_destination(struct mpic_msgr *msgr,
* @msgr: the message register whose IRQ is to be returned * @msgr: the message register whose IRQ is to be returned
* *
* Returns the IRQ number associated with the given message register. * Returns the IRQ number associated with the given message register.
* NO_IRQ is returned if this message register is not capable of * 0 is returned if this message register is not capable of receiving
* receiving interrupts. What message register can and cannot receive * interrupts. What message register can and cannot receive interrupts is
* interrupts is specified in the device tree for the system. * specified in the device tree for the system.
*/ */
static inline int mpic_msgr_get_irq(struct mpic_msgr *msgr) static inline int mpic_msgr_get_irq(struct mpic_msgr *msgr)
{ {

View File

@ -28,7 +28,7 @@ static int parport_pc_find_nonpci_ports (int autoirq, int autodma)
io1 = prop[1]; io2 = prop[2]; io1 = prop[1]; io2 = prop[2];
virq = irq_of_parse_and_map(np, 0); virq = irq_of_parse_and_map(np, 0);
if (virq == NO_IRQ) if (!virq)
continue; continue;
if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0) if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0)

View File

@ -227,7 +227,7 @@ int ibmebus_request_irq(u32 ist, irq_handler_t handler,
{ {
unsigned int irq = irq_create_mapping(NULL, ist); unsigned int irq = irq_create_mapping(NULL, ist);
if (irq == NO_IRQ) if (!irq)
return -EINVAL; return -EINVAL;
return request_irq(irq, handler, irq_flags, devname, dev_id); return request_irq(irq, handler, irq_flags, devname, dev_id);

View File

@ -519,7 +519,7 @@ void __do_irq(struct pt_regs *regs)
may_hard_irq_enable(); may_hard_irq_enable();
/* And finally process it */ /* And finally process it */
if (unlikely(irq == NO_IRQ)) if (unlikely(!irq))
__this_cpu_inc(irq_stat.spurious_irqs); __this_cpu_inc(irq_stat.spurious_irqs);
else else
generic_handle_irq(irq); generic_handle_irq(irq);

View File

@ -193,10 +193,10 @@ static int __init add_legacy_soc_port(struct device_node *np,
*/ */
if (tsi && !strcmp(tsi->type, "tsi-bridge")) if (tsi && !strcmp(tsi->type, "tsi-bridge"))
return add_legacy_port(np, -1, UPIO_TSI, addr, addr, return add_legacy_port(np, -1, UPIO_TSI, addr, addr,
NO_IRQ, legacy_port_flags, 0); 0, legacy_port_flags, 0);
else else
return add_legacy_port(np, -1, UPIO_MEM, addr, addr, return add_legacy_port(np, -1, UPIO_MEM, addr, addr,
NO_IRQ, legacy_port_flags, 0); 0, legacy_port_flags, 0);
} }
static int __init add_legacy_isa_port(struct device_node *np, static int __init add_legacy_isa_port(struct device_node *np,
@ -242,7 +242,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
/* Add port, irq will be dealt with later */ /* Add port, irq will be dealt with later */
return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]), return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]),
taddr, NO_IRQ, legacy_port_flags, 0); taddr, 0, legacy_port_flags, 0);
} }
@ -314,7 +314,7 @@ static int __init add_legacy_pci_port(struct device_node *np,
/* Add port, irq will be dealt with later. We passed a translated /* Add port, irq will be dealt with later. We passed a translated
* IO port value. It will be fixed up later along with the irq * IO port value. It will be fixed up later along with the irq
*/ */
return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, return add_legacy_port(np, index, iotype, base, addr, 0,
legacy_port_flags, np != pci_dev); legacy_port_flags, np != pci_dev);
} }
#endif #endif
@ -462,14 +462,14 @@ static void __init fixup_port_irq(int index,
DBG("fixup_port_irq(%d)\n", index); DBG("fixup_port_irq(%d)\n", index);
virq = irq_of_parse_and_map(np, 0); virq = irq_of_parse_and_map(np, 0);
if (virq == NO_IRQ && legacy_serial_infos[index].irq_check_parent) { if (!virq && legacy_serial_infos[index].irq_check_parent) {
np = of_get_parent(np); np = of_get_parent(np);
if (np == NULL) if (np == NULL)
return; return;
virq = irq_of_parse_and_map(np, 0); virq = irq_of_parse_and_map(np, 0);
of_node_put(np); of_node_put(np);
} }
if (virq == NO_IRQ) if (!virq)
return; return;
port->irq = virq; port->irq = virq;
@ -543,7 +543,7 @@ static int __init serial_dev_init(void)
struct plat_serial8250_port *port = &legacy_serial_ports[i]; struct plat_serial8250_port *port = &legacy_serial_ports[i];
struct device_node *np = legacy_serial_infos[i].np; struct device_node *np = legacy_serial_infos[i].np;
if (port->irq == NO_IRQ) if (!port->irq)
fixup_port_irq(i, np, port); fixup_port_irq(i, np, port);
if (port->iotype == UPIO_PORT) if (port->iotype == UPIO_PORT)
fixup_port_pio(i, np, port); fixup_port_pio(i, np, port);

View File

@ -360,7 +360,7 @@ static int pci_read_irq_line(struct pci_dev *pci_dev)
line, pin); line, pin);
virq = irq_create_mapping(NULL, line); virq = irq_create_mapping(NULL, line);
if (virq != NO_IRQ) if (virq)
irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
} else { } else {
pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n", pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
@ -369,7 +369,8 @@ static int pci_read_irq_line(struct pci_dev *pci_dev)
virq = irq_create_of_mapping(&oirq); virq = irq_create_of_mapping(&oirq);
} }
if(virq == NO_IRQ) {
if (!virq) {
pr_debug(" Failed to map !\n"); pr_debug(" Failed to map !\n");
return -1; return -1;
} }

View File

@ -178,7 +178,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
dev->hdr_type = PCI_HEADER_TYPE_NORMAL; dev->hdr_type = PCI_HEADER_TYPE_NORMAL;
dev->rom_base_reg = PCI_ROM_ADDRESS; dev->rom_base_reg = PCI_ROM_ADDRESS;
/* Maybe do a default OF mapping here */ /* Maybe do a default OF mapping here */
dev->irq = NO_IRQ; dev->irq = 0;
} }
of_pci_parse_addrs(node, dev); of_pci_parse_addrs(node, dev);

View File

@ -204,7 +204,7 @@ static void pika_setup_critical_temp(struct device_node *np,
i2c_smbus_write_byte_data(client, 3, 0); /* Tlow */ i2c_smbus_write_byte_data(client, 3, 0); /* Tlow */
irq = irq_of_parse_and_map(np, 0); irq = irq_of_parse_and_map(np, 0);
if (irq == NO_IRQ) { if (!irq) {
printk(KERN_ERR __FILE__ ": Unable to get ad7414 irq\n"); printk(KERN_ERR __FILE__ ": Unable to get ad7414 irq\n");
return; return;
} }

View File

@ -97,7 +97,7 @@ cpld_pic_get_irq(int offset, u8 ignore, u8 __iomem *statusp,
status |= (ignore | mask); status |= (ignore | mask);
if (status == 0xff) if (status == 0xff)
return NO_IRQ; return 0;
cpld_irq = ffz(status) + offset; cpld_irq = ffz(status) + offset;
@ -110,14 +110,14 @@ static void cpld_pic_cascade(struct irq_desc *desc)
irq = cpld_pic_get_irq(0, PCI_IGNORE, &cpld_regs->pci_status, irq = cpld_pic_get_irq(0, PCI_IGNORE, &cpld_regs->pci_status,
&cpld_regs->pci_mask); &cpld_regs->pci_mask);
if (irq != NO_IRQ) { if (irq) {
generic_handle_irq(irq); generic_handle_irq(irq);
return; return;
} }
irq = cpld_pic_get_irq(8, MISC_IGNORE, &cpld_regs->misc_status, irq = cpld_pic_get_irq(8, MISC_IGNORE, &cpld_regs->misc_status,
&cpld_regs->misc_mask); &cpld_regs->misc_mask);
if (irq != NO_IRQ) { if (irq) {
generic_handle_irq(irq); generic_handle_irq(irq);
return; return;
} }
@ -177,7 +177,7 @@ mpc5121_ads_cpld_pic_init(void)
goto end; goto end;
cascade_irq = irq_of_parse_and_map(np, 0); cascade_irq = irq_of_parse_and_map(np, 0);
if (cascade_irq == NO_IRQ) if (!cascade_irq)
goto end; goto end;
/* /*

View File

@ -473,7 +473,7 @@ static int mpc512x_lpbfifo_probe(struct platform_device *pdev)
} }
lpbfifo.irq = irq_of_parse_and_map(pdev->dev.of_node, 0); lpbfifo.irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
if (lpbfifo.irq == NO_IRQ) { if (!lpbfifo.irq) {
dev_err(&pdev->dev, "mapping irq failed\n"); dev_err(&pdev->dev, "mapping irq failed\n");
ret = -ENODEV; ret = -ENODEV;
goto err0; goto err0;

View File

@ -511,7 +511,7 @@ unsigned int mpc52xx_get_irq(void)
irq |= (MPC52xx_IRQ_L1_PERP << MPC52xx_IRQ_L1_OFFSET); irq |= (MPC52xx_IRQ_L1_PERP << MPC52xx_IRQ_L1_OFFSET);
} }
} else { } else {
return NO_IRQ; return 0;
} }
return irq_linear_revmap(mpc52xx_irqhost, irq); return irq_linear_revmap(mpc52xx_irqhost, irq);

View File

@ -131,7 +131,7 @@ int __init pq2ads_pci_init_irq(void)
} }
irq = irq_of_parse_and_map(np, 0); irq = irq_of_parse_and_map(np, 0);
if (irq == NO_IRQ) { if (!irq) {
printk(KERN_ERR "No interrupt in pci pic node.\n"); printk(KERN_ERR "No interrupt in pci pic node.\n");
of_node_put(np); of_node_put(np);
goto out; goto out;

View File

@ -89,7 +89,7 @@ static int __init of_fsl_spi_probe(char *type, char *compatible, u32 sysclk,
goto err; goto err;
ret = of_irq_to_resource(np, 0, &res[1]); ret = of_irq_to_resource(np, 0, &res[1]);
if (ret == NO_IRQ) if (!ret)
goto err; goto err;
pdev = platform_device_alloc("mpc83xx_spi", i); pdev = platform_device_alloc("mpc83xx_spi", i);

View File

@ -352,7 +352,7 @@ static int pmc_probe(struct platform_device *ofdev)
return -ENODEV; return -ENODEV;
pmc_irq = irq_of_parse_and_map(np, 0); pmc_irq = irq_of_parse_and_map(np, 0);
if (pmc_irq != NO_IRQ) { if (pmc_irq) {
ret = request_irq(pmc_irq, pmc_irq_handler, IRQF_SHARED, ret = request_irq(pmc_irq, pmc_irq_handler, IRQF_SHARED,
"pmc", ofdev); "pmc", ofdev);
@ -400,7 +400,7 @@ out_syscr:
out_pmc: out_pmc:
iounmap(pmc_regs); iounmap(pmc_regs);
out: out:
if (pmc_irq != NO_IRQ) if (pmc_irq)
free_irq(pmc_irq, ofdev); free_irq(pmc_irq, ofdev);
return ret; return ret;

View File

@ -76,7 +76,7 @@ void __init mpc85xx_cpm2_pic_init(void)
return; return;
} }
irq = irq_of_parse_and_map(np, 0); irq = irq_of_parse_and_map(np, 0);
if (irq == NO_IRQ) { if (!irq) {
of_node_put(np); of_node_put(np);
printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n"); printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n");
return; return;

View File

@ -196,7 +196,7 @@ static void mpc85xx_8259_cascade_handler(struct irq_desc *desc)
{ {
unsigned int cascade_irq = i8259_irq(); unsigned int cascade_irq = i8259_irq();
if (cascade_irq != NO_IRQ) if (cascade_irq)
/* handle an interrupt from the 8259 */ /* handle an interrupt from the 8259 */
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
@ -247,7 +247,7 @@ static int mpc85xx_cds_8259_attach(void)
} }
cascade_irq = irq_of_parse_and_map(cascade_node, 0); cascade_irq = irq_of_parse_and_map(cascade_node, 0);
if (cascade_irq == NO_IRQ) { if (!cascade_irq) {
printk(KERN_ERR "Failed to map cascade interrupt\n"); printk(KERN_ERR "Failed to map cascade interrupt\n");
return -ENXIO; return -ENXIO;
} }

View File

@ -51,7 +51,7 @@ static void mpc85xx_8259_cascade(struct irq_desc *desc)
struct irq_chip *chip = irq_desc_get_chip(desc); struct irq_chip *chip = irq_desc_get_chip(desc);
unsigned int cascade_irq = i8259_irq(); unsigned int cascade_irq = i8259_irq();
if (cascade_irq != NO_IRQ) { if (cascade_irq) {
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
} }
chip->irq_eoi(&desc->irq_data); chip->irq_eoi(&desc->irq_data);
@ -96,7 +96,7 @@ void __init mpc85xx_ds_pic_init(void)
} }
cascade_irq = irq_of_parse_and_map(cascade_node, 0); cascade_irq = irq_of_parse_and_map(cascade_node, 0);
if (cascade_irq == NO_IRQ) { if (!cascade_irq) {
printk(KERN_ERR "Failed to map cascade interrupt\n"); printk(KERN_ERR "Failed to map cascade interrupt\n");
return; return;
} }

View File

@ -78,7 +78,7 @@ static inline unsigned int socrates_fpga_pic_get_irq(unsigned int irq)
break; break;
} }
if (i == 3) if (i == 3)
return NO_IRQ; return 0;
raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
cause = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(i)); cause = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(i));
@ -103,7 +103,7 @@ static void socrates_fpga_pic_cascade(struct irq_desc *desc)
*/ */
cascade_irq = socrates_fpga_pic_get_irq(irq); cascade_irq = socrates_fpga_pic_get_irq(irq);
if (cascade_irq != NO_IRQ) if (cascade_irq)
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
chip->irq_eoi(&desc->irq_data); chip->irq_eoi(&desc->irq_data);
} }
@ -292,7 +292,7 @@ void socrates_fpga_pic_init(struct device_node *pic)
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
socrates_fpga_irqs[i] = irq_of_parse_and_map(pic, i); socrates_fpga_irqs[i] = irq_of_parse_and_map(pic, i);
if (socrates_fpga_irqs[i] == NO_IRQ) { if (!socrates_fpga_irqs[i]) {
pr_warning("FPGA PIC: can't get irq%d.\n", i); pr_warning("FPGA PIC: can't get irq%d.\n", i);
continue; continue;
} }

View File

@ -22,7 +22,7 @@ static void mpc86xx_8259_cascade(struct irq_desc *desc)
struct irq_chip *chip = irq_desc_get_chip(desc); struct irq_chip *chip = irq_desc_get_chip(desc);
unsigned int cascade_irq = i8259_irq(); unsigned int cascade_irq = i8259_irq();
if (cascade_irq != NO_IRQ) if (cascade_irq)
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
chip->irq_eoi(&desc->irq_data); chip->irq_eoi(&desc->irq_data);
@ -58,7 +58,7 @@ void __init mpc86xx_init_irq(void)
} }
cascade_irq = irq_of_parse_and_map(cascade_node, 0); cascade_irq = irq_of_parse_and_map(cascade_node, 0);
if (cascade_irq == NO_IRQ) { if (!cascade_irq) {
printk(KERN_ERR "Failed to map cascade interrupt\n"); printk(KERN_ERR "Failed to map cascade interrupt\n");
return; return;
} }

View File

@ -241,6 +241,6 @@ void __init mpc8xx_pics_init(void)
} }
irq = cpm_pic_init(); irq = cpm_pic_init();
if (irq != NO_IRQ) if (irq)
irq_set_chained_handler(irq, cpm_cascade); irq_set_chained_handler(irq, cpm_cascade);
} }

View File

@ -271,7 +271,7 @@ static int axon_msi_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
for_each_pci_msi_entry(entry, dev) { for_each_pci_msi_entry(entry, dev) {
virq = irq_create_direct_mapping(msic->irq_domain); virq = irq_create_direct_mapping(msic->irq_domain);
if (virq == NO_IRQ) { if (!virq) {
dev_warn(&dev->dev, dev_warn(&dev->dev,
"axon_msi: virq allocation failed!\n"); "axon_msi: virq allocation failed!\n");
return -1; return -1;
@ -293,7 +293,7 @@ static void axon_msi_teardown_msi_irqs(struct pci_dev *dev)
dev_dbg(&dev->dev, "axon_msi: tearing down msi irqs\n"); dev_dbg(&dev->dev, "axon_msi: tearing down msi irqs\n");
for_each_pci_msi_entry(entry, dev) { for_each_pci_msi_entry(entry, dev) {
if (entry->irq == NO_IRQ) if (!entry->irq)
continue; continue;
irq_set_msi_desc(entry->irq, NULL); irq_set_msi_desc(entry->irq, NULL);
@ -375,7 +375,7 @@ static int axon_msi_probe(struct platform_device *device)
} }
virq = irq_of_parse_and_map(dn, 0); virq = irq_of_parse_and_map(dn, 0);
if (virq == NO_IRQ) { if (!virq) {
printk(KERN_ERR "axon_msi: irq parse and map failed for %s\n", printk(KERN_ERR "axon_msi: irq parse and map failed for %s\n",
dn->full_name); dn->full_name);
goto out_free_fifo; goto out_free_fifo;

View File

@ -123,7 +123,7 @@ static void iic_ioexc_cascade(struct irq_desc *desc)
unsigned int cirq = unsigned int cirq =
irq_linear_revmap(iic_host, irq_linear_revmap(iic_host,
base | cascade); base | cascade);
if (cirq != NO_IRQ) if (cirq)
generic_handle_irq(cirq); generic_handle_irq(cirq);
} }
/* post-ack level interrupts */ /* post-ack level interrupts */
@ -153,10 +153,10 @@ static unsigned int iic_get_irq(void)
*(unsigned long *) &pending = *(unsigned long *) &pending =
in_be64((u64 __iomem *) &iic->regs->pending_destr); in_be64((u64 __iomem *) &iic->regs->pending_destr);
if (!(pending.flags & CBE_IIC_IRQ_VALID)) if (!(pending.flags & CBE_IIC_IRQ_VALID))
return NO_IRQ; return 0;
virq = irq_linear_revmap(iic_host, iic_pending_to_hwnum(pending)); virq = irq_linear_revmap(iic_host, iic_pending_to_hwnum(pending));
if (virq == NO_IRQ) if (!virq)
return NO_IRQ; return 0;
iic->eoi_stack[++iic->eoi_ptr] = pending.prio; iic->eoi_stack[++iic->eoi_ptr] = pending.prio;
BUG_ON(iic->eoi_ptr > 15); BUG_ON(iic->eoi_ptr > 15);
return virq; return virq;
@ -192,7 +192,7 @@ static void iic_request_ipi(int msg)
int virq; int virq;
virq = irq_create_mapping(iic_host, iic_msg_to_irq(msg)); virq = irq_create_mapping(iic_host, iic_msg_to_irq(msg));
if (virq == NO_IRQ) { if (!virq) {
printk(KERN_ERR printk(KERN_ERR
"iic: failed to map IPI %s\n", smp_ipi_name[msg]); "iic: failed to map IPI %s\n", smp_ipi_name[msg]);
return; return;
@ -347,7 +347,7 @@ static int __init setup_iic(void)
cascade |= 1 << IIC_IRQ_CLASS_SHIFT; cascade |= 1 << IIC_IRQ_CLASS_SHIFT;
cascade |= IIC_UNIT_IIC; cascade |= IIC_UNIT_IIC;
cascade = irq_create_mapping(iic_host, cascade); cascade = irq_create_mapping(iic_host, cascade);
if (cascade == NO_IRQ) if (!cascade)
continue; continue;
/* /*
* irq_data is a generic pointer that gets passed back * irq_data is a generic pointer that gets passed back

View File

@ -411,7 +411,7 @@ static void cell_iommu_enable_hardware(struct cbe_iommu *iommu)
virq = irq_create_mapping(NULL, virq = irq_create_mapping(NULL,
IIC_IRQ_IOEX_ATI | (iommu->nid << IIC_IRQ_NODE_SHIFT)); IIC_IRQ_IOEX_ATI | (iommu->nid << IIC_IRQ_NODE_SHIFT));
BUG_ON(virq == NO_IRQ); BUG_ON(!virq);
ret = request_irq(virq, ioc_interrupt, 0, iommu->name, iommu); ret = request_irq(virq, ioc_interrupt, 0, iommu->name, iommu);
BUG_ON(ret); BUG_ON(ret);

View File

@ -385,7 +385,7 @@ static int __init cbe_init_pm_irq(void)
for_each_online_node(node) { for_each_online_node(node) {
irq = irq_create_mapping(NULL, IIC_IRQ_IOEX_PMI | irq = irq_create_mapping(NULL, IIC_IRQ_IOEX_PMI |
(node << IIC_IRQ_NODE_SHIFT)); (node << IIC_IRQ_NODE_SHIFT));
if (irq == NO_IRQ) { if (!irq) {
printk("ERROR: Unable to allocate irq for node %d\n", printk("ERROR: Unable to allocate irq for node %d\n",
node); node);
return -EINVAL; return -EINVAL;
@ -412,7 +412,7 @@ void cbe_sync_irq(int node)
IIC_IRQ_IOEX_PMI IIC_IRQ_IOEX_PMI
| (node << IIC_IRQ_NODE_SHIFT)); | (node << IIC_IRQ_NODE_SHIFT));
if (irq == NO_IRQ) { if (!irq) {
printk(KERN_WARNING "ERROR, unable to get existing irq %d " \ printk(KERN_WARNING "ERROR, unable to get existing irq %d " \
"for node %d\n", irq, node); "for node %d\n", irq, node);
return; return;

View File

@ -207,11 +207,11 @@ static void spider_irq_cascade(struct irq_desc *desc)
cs = in_be32(pic->regs + TIR_CS) >> 24; cs = in_be32(pic->regs + TIR_CS) >> 24;
if (cs == SPIDER_IRQ_INVALID) if (cs == SPIDER_IRQ_INVALID)
virq = NO_IRQ; virq = 0;
else else
virq = irq_linear_revmap(pic->host, cs); virq = irq_linear_revmap(pic->host, cs);
if (virq != NO_IRQ) if (virq)
generic_handle_irq(virq); generic_handle_irq(virq);
chip->irq_eoi(&desc->irq_data); chip->irq_eoi(&desc->irq_data);
@ -245,19 +245,19 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
/* Now do the horrible hacks */ /* Now do the horrible hacks */
tmp = of_get_property(of_node, "#interrupt-cells", NULL); tmp = of_get_property(of_node, "#interrupt-cells", NULL);
if (tmp == NULL) if (tmp == NULL)
return NO_IRQ; return 0;
intsize = *tmp; intsize = *tmp;
imap = of_get_property(of_node, "interrupt-map", &imaplen); imap = of_get_property(of_node, "interrupt-map", &imaplen);
if (imap == NULL || imaplen < (intsize + 1)) if (imap == NULL || imaplen < (intsize + 1))
return NO_IRQ; return 0;
iic = of_find_node_by_phandle(imap[intsize]); iic = of_find_node_by_phandle(imap[intsize]);
if (iic == NULL) if (iic == NULL)
return NO_IRQ; return 0;
imap += intsize + 1; imap += intsize + 1;
tmp = of_get_property(iic, "#interrupt-cells", NULL); tmp = of_get_property(iic, "#interrupt-cells", NULL);
if (tmp == NULL) { if (tmp == NULL) {
of_node_put(iic); of_node_put(iic);
return NO_IRQ; return 0;
} }
intsize = *tmp; intsize = *tmp;
/* Assume unit is last entry of interrupt specifier */ /* Assume unit is last entry of interrupt specifier */
@ -266,7 +266,7 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
tmp = of_get_property(iic, "ibm,interrupt-server-ranges", NULL); tmp = of_get_property(iic, "ibm,interrupt-server-ranges", NULL);
if (tmp == NULL) { if (tmp == NULL) {
of_node_put(iic); of_node_put(iic);
return NO_IRQ; return 0;
} }
/* ugly as hell but works for now */ /* ugly as hell but works for now */
pic->node_id = (*tmp) >> 1; pic->node_id = (*tmp) >> 1;
@ -281,7 +281,7 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
(pic->node_id << IIC_IRQ_NODE_SHIFT) | (pic->node_id << IIC_IRQ_NODE_SHIFT) |
(2 << IIC_IRQ_CLASS_SHIFT) | (2 << IIC_IRQ_CLASS_SHIFT) |
unit); unit);
if (virq == NO_IRQ) if (!virq)
printk(KERN_ERR "spider_pic: failed to map cascade !"); printk(KERN_ERR "spider_pic: failed to map cascade !");
return virq; return virq;
} }
@ -318,7 +318,7 @@ static void __init spider_init_one(struct device_node *of_node, int chip,
/* Hook up the cascade interrupt to the iic and nodeid */ /* Hook up the cascade interrupt to the iic and nodeid */
virq = spider_find_cascade_and_node(pic); virq = spider_find_cascade_and_node(pic);
if (virq == NO_IRQ) if (!virq)
return; return;
irq_set_handler_data(virq, pic); irq_set_handler_data(virq, pic);
irq_set_chained_handler(virq, spider_irq_cascade); irq_set_chained_handler(virq, spider_irq_cascade);

View File

@ -402,7 +402,7 @@ static int spu_request_irqs(struct spu *spu)
{ {
int ret = 0; int ret = 0;
if (spu->irqs[0] != NO_IRQ) { if (spu->irqs[0]) {
snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0",
spu->number); spu->number);
ret = request_irq(spu->irqs[0], spu_irq_class_0, ret = request_irq(spu->irqs[0], spu_irq_class_0,
@ -410,7 +410,7 @@ static int spu_request_irqs(struct spu *spu)
if (ret) if (ret)
goto bail0; goto bail0;
} }
if (spu->irqs[1] != NO_IRQ) { if (spu->irqs[1]) {
snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1",
spu->number); spu->number);
ret = request_irq(spu->irqs[1], spu_irq_class_1, ret = request_irq(spu->irqs[1], spu_irq_class_1,
@ -418,7 +418,7 @@ static int spu_request_irqs(struct spu *spu)
if (ret) if (ret)
goto bail1; goto bail1;
} }
if (spu->irqs[2] != NO_IRQ) { if (spu->irqs[2]) {
snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2",
spu->number); spu->number);
ret = request_irq(spu->irqs[2], spu_irq_class_2, ret = request_irq(spu->irqs[2], spu_irq_class_2,
@ -429,10 +429,10 @@ static int spu_request_irqs(struct spu *spu)
return 0; return 0;
bail2: bail2:
if (spu->irqs[1] != NO_IRQ) if (spu->irqs[1])
free_irq(spu->irqs[1], spu); free_irq(spu->irqs[1], spu);
bail1: bail1:
if (spu->irqs[0] != NO_IRQ) if (spu->irqs[0])
free_irq(spu->irqs[0], spu); free_irq(spu->irqs[0], spu);
bail0: bail0:
return ret; return ret;
@ -440,11 +440,11 @@ bail0:
static void spu_free_irqs(struct spu *spu) static void spu_free_irqs(struct spu *spu)
{ {
if (spu->irqs[0] != NO_IRQ) if (spu->irqs[0])
free_irq(spu->irqs[0], spu); free_irq(spu->irqs[0], spu);
if (spu->irqs[1] != NO_IRQ) if (spu->irqs[1])
free_irq(spu->irqs[1], spu); free_irq(spu->irqs[1], spu);
if (spu->irqs[2] != NO_IRQ) if (spu->irqs[2])
free_irq(spu->irqs[2], spu); free_irq(spu->irqs[2], spu);
} }

View File

@ -105,7 +105,10 @@ static int __init spu_map_interrupts_old(struct spu *spu,
spu->irqs[2] = irq_create_mapping(NULL, IIC_IRQ_CLASS_2 | isrc); spu->irqs[2] = irq_create_mapping(NULL, IIC_IRQ_CLASS_2 | isrc);
/* Right now, we only fail if class 2 failed */ /* Right now, we only fail if class 2 failed */
return spu->irqs[2] == NO_IRQ ? -EINVAL : 0; if (!spu->irqs[2])
return -EINVAL;
return 0;
} }
static void __iomem * __init spu_map_prop_old(struct spu *spu, static void __iomem * __init spu_map_prop_old(struct spu *spu,
@ -191,7 +194,7 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
pr_debug(" irq %d no 0x%x on %s\n", i, oirq.args[0], pr_debug(" irq %d no 0x%x on %s\n", i, oirq.args[0],
oirq.np->full_name); oirq.np->full_name);
spu->irqs[i] = irq_create_of_mapping(&oirq); spu->irqs[i] = irq_create_of_mapping(&oirq);
if (spu->irqs[i] == NO_IRQ) { if (!spu->irqs[i]) {
pr_debug("spu_new: failed to map it !\n"); pr_debug("spu_new: failed to map it !\n");
goto err; goto err;
} }
@ -202,7 +205,7 @@ err:
pr_debug("failed to map irq %x for spu %s\n", *oirq.args, pr_debug("failed to map irq %x for spu %s\n", *oirq.args,
spu->name); spu->name);
for (; i >= 0; i--) { for (; i >= 0; i--) {
if (spu->irqs[i] != NO_IRQ) if (spu->irqs[i])
irq_dispose_mapping(spu->irqs[i]); irq_dispose_mapping(spu->irqs[i]);
} }
return ret; return ret;

View File

@ -368,7 +368,7 @@ static void chrp_8259_cascade(struct irq_desc *desc)
struct irq_chip *chip = irq_desc_get_chip(desc); struct irq_chip *chip = irq_desc_get_chip(desc);
unsigned int cascade_irq = i8259_irq(); unsigned int cascade_irq = i8259_irq();
if (cascade_irq != NO_IRQ) if (cascade_irq)
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
chip->irq_eoi(&desc->irq_data); chip->irq_eoi(&desc->irq_data);
@ -514,7 +514,7 @@ static void __init chrp_find_8259(void)
} }
if (chrp_mpic != NULL) { if (chrp_mpic != NULL) {
cascade_irq = irq_of_parse_and_map(pic, 0); cascade_irq = irq_of_parse_and_map(pic, 0);
if (cascade_irq == NO_IRQ) if (!cascade_irq)
printk(KERN_ERR "i8259: failed to map cascade irq\n"); printk(KERN_ERR "i8259: failed to map cascade irq\n");
else else
irq_set_chained_handler(cascade_irq, irq_set_chained_handler(cascade_irq,

View File

@ -181,7 +181,7 @@ unsigned int flipper_pic_get_irq(void)
irq_status = in_be32(io_base + FLIPPER_ICR) & irq_status = in_be32(io_base + FLIPPER_ICR) &
in_be32(io_base + FLIPPER_IMR); in_be32(io_base + FLIPPER_IMR);
if (irq_status == 0) if (irq_status == 0)
return NO_IRQ; /* no more IRQs pending */ return 0; /* no more IRQs pending */
irq = __ffs(irq_status); irq = __ffs(irq_status);
return irq_linear_revmap(flipper_irq_host, irq); return irq_linear_revmap(flipper_irq_host, irq);

View File

@ -114,7 +114,7 @@ static unsigned int __hlwd_pic_get_irq(struct irq_domain *h)
irq_status = in_be32(io_base + HW_BROADWAY_ICR) & irq_status = in_be32(io_base + HW_BROADWAY_ICR) &
in_be32(io_base + HW_BROADWAY_IMR); in_be32(io_base + HW_BROADWAY_IMR);
if (irq_status == 0) if (irq_status == 0)
return NO_IRQ; /* no more IRQs pending */ return 0; /* no more IRQs pending */
irq = __ffs(irq_status); irq = __ffs(irq_status);
return irq_linear_revmap(h, irq); return irq_linear_revmap(h, irq);
@ -131,7 +131,7 @@ static void hlwd_pic_irq_cascade(struct irq_desc *desc)
raw_spin_unlock(&desc->lock); raw_spin_unlock(&desc->lock);
virq = __hlwd_pic_get_irq(irq_domain); virq = __hlwd_pic_get_irq(irq_domain);
if (virq != NO_IRQ) if (virq)
generic_handle_irq(virq); generic_handle_irq(virq);
else else
pr_err("spurious interrupt!\n"); pr_err("spurious interrupt!\n");

View File

@ -47,7 +47,7 @@ static void mvme5100_8259_cascade(struct irq_desc *desc)
struct irq_chip *chip = irq_desc_get_chip(desc); struct irq_chip *chip = irq_desc_get_chip(desc);
unsigned int cascade_irq = i8259_irq(); unsigned int cascade_irq = i8259_irq();
if (cascade_irq != NO_IRQ) if (cascade_irq)
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
chip->irq_eoi(&desc->irq_data); chip->irq_eoi(&desc->irq_data);
@ -84,7 +84,7 @@ static void __init mvme5100_pic_init(void)
} }
cirq = irq_of_parse_and_map(cp, 0); cirq = irq_of_parse_and_map(cp, 0);
if (cirq == NO_IRQ) { if (!cirq) {
pr_warn("mvme5100_pic_init: no cascade interrupt?\n"); pr_warn("mvme5100_pic_init: no cascade interrupt?\n");
return; return;
} }

View File

@ -552,7 +552,7 @@ void maple_pci_irq_fixup(struct pci_dev *dev)
pci_bus_to_host(dev->bus) == u4_pcie) { pci_bus_to_host(dev->bus) == u4_pcie) {
printk(KERN_DEBUG "Fixup U4 PCIe IRQ\n"); printk(KERN_DEBUG "Fixup U4 PCIe IRQ\n");
dev->irq = irq_create_mapping(NULL, 1); dev->irq = irq_create_mapping(NULL, 1);
if (dev->irq != NO_IRQ) if (dev->irq)
irq_set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW); irq_set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW);
} }
@ -562,7 +562,7 @@ void maple_pci_irq_fixup(struct pci_dev *dev)
if (dev->vendor == PCI_VENDOR_ID_AMD && if (dev->vendor == PCI_VENDOR_ID_AMD &&
dev->device == PCI_DEVICE_ID_AMD_8111_IDE && dev->device == PCI_DEVICE_ID_AMD_8111_IDE &&
(dev->class & 5) != 5) { (dev->class & 5) != 5) {
dev->irq = NO_IRQ; dev->irq = 0;
} }
DBG(" <- maple_pci_irq_fixup\n"); DBG(" <- maple_pci_irq_fixup\n");
@ -648,7 +648,7 @@ int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)
return defirq; return defirq;
} }
irq = irq_of_parse_and_map(np, channel & 0x1); irq = irq_of_parse_and_map(np, channel & 0x1);
if (irq == NO_IRQ) { if (!irq) {
printk("Failed to map onboard IDE interrupt for channel %d\n", printk("Failed to map onboard IDE interrupt for channel %d\n",
channel); channel);
return defirq; return defirq;

View File

@ -76,7 +76,7 @@ static int __init pasemi_register_i2c_devices(void)
} }
info.irq = irq_of_parse_and_map(node, 0); info.irq = irq_of_parse_and_map(node, 0);
if (info.irq == NO_IRQ) if (!info.irq)
info.irq = -1; info.irq = -1;
if (find_i2c_driver(node, &info) < 0) if (find_i2c_driver(node, &info) < 0)

View File

@ -68,7 +68,7 @@ static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev)
pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev); pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev);
for_each_pci_msi_entry(entry, pdev) { for_each_pci_msi_entry(entry, pdev) {
if (entry->irq == NO_IRQ) if (!entry->irq)
continue; continue;
hwirq = virq_to_hw(entry->irq); hwirq = virq_to_hw(entry->irq);
@ -109,7 +109,7 @@ static int pasemi_msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
} }
virq = irq_create_mapping(msi_mpic->irqhost, hwirq); virq = irq_create_mapping(msi_mpic->irqhost, hwirq);
if (virq == NO_IRQ) { if (!virq) {
pr_debug("pasemi_msi: failed mapping hwirq 0x%x\n", pr_debug("pasemi_msi: failed mapping hwirq 0x%x\n",
hwirq); hwirq);
msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq,

View File

@ -59,7 +59,7 @@ struct mce_regs {
static struct mce_regs mce_regs[MAX_MCE_REGS]; static struct mce_regs mce_regs[MAX_MCE_REGS];
static int num_mce_regs; static int num_mce_regs;
static int nmi_virq = NO_IRQ; static int nmi_virq = 0;
static void __noreturn pas_restart(char *cmd) static void __noreturn pas_restart(char *cmd)
@ -264,7 +264,7 @@ static int pas_machine_check_handler(struct pt_regs *regs)
srr0 = regs->nip; srr0 = regs->nip;
srr1 = regs->msr; srr1 = regs->msr;
if (nmi_virq != NO_IRQ && mpic_get_mcirq() == nmi_virq) { if (nmi_virq && mpic_get_mcirq() == nmi_virq) {
printk(KERN_ERR "NMI delivered\n"); printk(KERN_ERR "NMI delivered\n");
debugger(regs); debugger(regs);
mpic_end_irq(irq_get_irq_data(nmi_virq)); mpic_end_irq(irq_get_irq_data(nmi_virq));

View File

@ -401,7 +401,7 @@ static int kw_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize,
{ {
struct pmac_i2c_host_kw *host = bus->hostdata; struct pmac_i2c_host_kw *host = bus->hostdata;
u8 mode_reg = host->speed; u8 mode_reg = host->speed;
int use_irq = host->irq != NO_IRQ && !bus->polled; int use_irq = host->irq && !bus->polled;
/* Setup mode & subaddress if any */ /* Setup mode & subaddress if any */
switch(bus->mode) { switch(bus->mode) {
@ -535,7 +535,7 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
break; break;
} }
host->irq = irq_of_parse_and_map(np, 0); host->irq = irq_of_parse_and_map(np, 0);
if (host->irq == NO_IRQ) if (!host->irq)
printk(KERN_WARNING printk(KERN_WARNING
"low_i2c: Failed to map interrupt for %s\n", "low_i2c: Failed to map interrupt for %s\n",
np->full_name); np->full_name);
@ -557,7 +557,7 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
*/ */
if (request_irq(host->irq, kw_i2c_irq, IRQF_NO_SUSPEND, if (request_irq(host->irq, kw_i2c_irq, IRQF_NO_SUSPEND,
"keywest i2c", host)) "keywest i2c", host))
host->irq = NO_IRQ; host->irq = 0;
printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n", printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n",
*addrp, host->irq, np->full_name); *addrp, host->irq, np->full_name);

View File

@ -26,7 +26,7 @@ static irqreturn_t macio_gpio_irq(int irq, void *data)
static int macio_do_gpio_irq_enable(struct pmf_function *func) static int macio_do_gpio_irq_enable(struct pmf_function *func)
{ {
unsigned int irq = irq_of_parse_and_map(func->node, 0); unsigned int irq = irq_of_parse_and_map(func->node, 0);
if (irq == NO_IRQ) if (!irq)
return -EINVAL; return -EINVAL;
return request_irq(irq, macio_gpio_irq, 0, func->node->name, func); return request_irq(irq, macio_gpio_irq, 0, func->node->name, func);
} }
@ -34,7 +34,7 @@ static int macio_do_gpio_irq_enable(struct pmf_function *func)
static int macio_do_gpio_irq_disable(struct pmf_function *func) static int macio_do_gpio_irq_disable(struct pmf_function *func)
{ {
unsigned int irq = irq_of_parse_and_map(func->node, 0); unsigned int irq = irq_of_parse_and_map(func->node, 0);
if (irq == NO_IRQ) if (!irq)
return -EINVAL; return -EINVAL;
free_irq(irq, func); free_irq(irq, func);
return 0; return 0;

View File

@ -251,7 +251,7 @@ static unsigned int pmac_pic_get_irq(void)
} }
raw_spin_unlock_irqrestore(&pmac_pic_lock, flags); raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
if (unlikely(irq < 0)) if (unlikely(irq < 0))
return NO_IRQ; return 0;
return irq_linear_revmap(pmac_pic_host, irq); return irq_linear_revmap(pmac_pic_host, irq);
} }
@ -389,7 +389,7 @@ static void __init pmac_pic_probe_oldstyle(void)
out_le32(&pmac_irq_hw[i]->enable, 0); out_le32(&pmac_irq_hw[i]->enable, 0);
/* Hookup cascade irq */ /* Hookup cascade irq */
if (slave && pmac_irq_cascade != NO_IRQ) if (slave && pmac_irq_cascade)
setup_irq(pmac_irq_cascade, &gatwick_cascade_action); setup_irq(pmac_irq_cascade, &gatwick_cascade_action);
printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs); printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs);
@ -444,7 +444,7 @@ static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic)
pswitch = of_find_node_by_name(NULL, "programmer-switch"); pswitch = of_find_node_by_name(NULL, "programmer-switch");
if (pswitch) { if (pswitch) {
nmi_irq = irq_of_parse_and_map(pswitch, 0); nmi_irq = irq_of_parse_and_map(pswitch, 0);
if (nmi_irq != NO_IRQ) { if (nmi_irq) {
mpic_irq_set_priority(nmi_irq, 9); mpic_irq_set_priority(nmi_irq, 9);
setup_irq(nmi_irq, &xmon_action); setup_irq(nmi_irq, &xmon_action);
} }

View File

@ -222,7 +222,7 @@ int __init opal_event_init(void)
/* Get hardware and virtual IRQ */ /* Get hardware and virtual IRQ */
irq = be32_to_cpup(irqs); irq = be32_to_cpup(irqs);
virq = irq_create_mapping(NULL, irq); virq = irq_create_mapping(NULL, irq);
if (virq == NO_IRQ) { if (!virq) {
pr_warn("Failed to map irq 0x%x\n", irq); pr_warn("Failed to map irq 0x%x\n", irq);
continue; continue;
} }
@ -260,7 +260,7 @@ machine_arch_initcall(powernv, opal_event_init);
int opal_event_request(unsigned int opal_event_nr) int opal_event_request(unsigned int opal_event_nr)
{ {
if (WARN_ON_ONCE(!opal_event_irqchip.domain)) if (WARN_ON_ONCE(!opal_event_irqchip.domain))
return NO_IRQ; return 0;
return irq_create_mapping(opal_event_irqchip.domain, opal_event_nr); return irq_create_mapping(opal_event_irqchip.domain, opal_event_nr);
} }

View File

@ -344,7 +344,7 @@ int pnv_cxl_cx4_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
return (hwirq ? hwirq : -ENOMEM); return (hwirq ? hwirq : -ENOMEM);
virq = irq_create_mapping(NULL, hwirq); virq = irq_create_mapping(NULL, hwirq);
if (virq == NO_IRQ) { if (!virq) {
pr_warn("%s: Failed to map cxl mode MSI to linux irq\n", pr_warn("%s: Failed to map cxl mode MSI to linux irq\n",
pci_name(pdev)); pci_name(pdev));
return -ENOMEM; return -ENOMEM;
@ -374,7 +374,7 @@ void pnv_cxl_cx4_teardown_msi_irqs(struct pci_dev *pdev)
return; return;
for_each_pci_msi_entry(entry, pdev) { for_each_pci_msi_entry(entry, pdev) {
if (entry->irq == NO_IRQ) if (!entry->irq)
continue; continue;
hwirq = virq_to_hw(entry->irq); hwirq = virq_to_hw(entry->irq);
irq_set_msi_desc(entry->irq, NULL); irq_set_msi_desc(entry->irq, NULL);

View File

@ -186,7 +186,7 @@ int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
return -ENOSPC; return -ENOSPC;
} }
virq = irq_create_mapping(NULL, phb->msi_base + hwirq); virq = irq_create_mapping(NULL, phb->msi_base + hwirq);
if (virq == NO_IRQ) { if (!virq) {
pr_warn("%s: Failed to map MSI to linux irq\n", pr_warn("%s: Failed to map MSI to linux irq\n",
pci_name(pdev)); pci_name(pdev));
msi_bitmap_free_hwirqs(&phb->msi_bmp, hwirq, 1); msi_bitmap_free_hwirqs(&phb->msi_bmp, hwirq, 1);
@ -217,7 +217,7 @@ void pnv_teardown_msi_irqs(struct pci_dev *pdev)
return; return;
for_each_pci_msi_entry(entry, pdev) { for_each_pci_msi_entry(entry, pdev) {
if (entry->irq == NO_IRQ) if (!entry->irq)
continue; continue;
hwirq = virq_to_hw(entry->irq); hwirq = virq_to_hw(entry->irq);
irq_set_msi_desc(entry->irq, NULL); irq_set_msi_desc(entry->irq, NULL);

View File

@ -192,7 +192,7 @@ static int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
*virq = irq_create_mapping(NULL, outlet); *virq = irq_create_mapping(NULL, outlet);
if (*virq == NO_IRQ) { if (!*virq) {
FAIL("%s:%d: irq_create_mapping failed: outlet %lu\n", FAIL("%s:%d: irq_create_mapping failed: outlet %lu\n",
__func__, __LINE__, outlet); __func__, __LINE__, outlet);
result = -ENOMEM; result = -ENOMEM;
@ -339,7 +339,7 @@ int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq)
if (result) { if (result) {
FAIL("%s:%d: lv1_construct_event_receive_port failed: %s\n", FAIL("%s:%d: lv1_construct_event_receive_port failed: %s\n",
__func__, __LINE__, ps3_result(result)); __func__, __LINE__, ps3_result(result));
*virq = NO_IRQ; *virq = 0;
return result; return result;
} }
@ -418,7 +418,7 @@ int ps3_sb_event_receive_port_setup(struct ps3_system_bus_device *dev,
" failed: %s\n", __func__, __LINE__, " failed: %s\n", __func__, __LINE__,
ps3_result(result)); ps3_result(result));
ps3_event_receive_port_destroy(*virq); ps3_event_receive_port_destroy(*virq);
*virq = NO_IRQ; *virq = 0;
return result; return result;
} }
@ -724,12 +724,12 @@ static unsigned int ps3_get_irq(void)
asm volatile("cntlzd %0,%1" : "=r" (plug) : "r" (x)); asm volatile("cntlzd %0,%1" : "=r" (plug) : "r" (x));
plug &= 0x3f; plug &= 0x3f;
if (unlikely(plug == NO_IRQ)) { if (unlikely(!plug)) {
DBG("%s:%d: no plug found: thread_id %llu\n", __func__, DBG("%s:%d: no plug found: thread_id %llu\n", __func__,
__LINE__, pd->thread_id); __LINE__, pd->thread_id);
dump_bmp(&per_cpu(ps3_private, 0)); dump_bmp(&per_cpu(ps3_private, 0));
dump_bmp(&per_cpu(ps3_private, 1)); dump_bmp(&per_cpu(ps3_private, 1));
return NO_IRQ; return 0;
} }
#if defined(DEBUG) #if defined(DEBUG)

View File

@ -91,7 +91,7 @@ static void __init ps3_smp_probe(void)
result = smp_request_message_ipi(virqs[i], i); result = smp_request_message_ipi(virqs[i], i);
if (result) if (result)
virqs[i] = NO_IRQ; virqs[i] = 0;
else else
ps3_register_ipi_irq(cpu, virqs[i]); ps3_register_ipi_irq(cpu, virqs[i]);
} }
@ -112,7 +112,7 @@ void ps3_smp_cleanup_cpu(int cpu)
for (i = 0; i < MSG_COUNT; i++) { for (i = 0; i < MSG_COUNT; i++) {
/* Can't call free_irq from interrupt context. */ /* Can't call free_irq from interrupt context. */
ps3_event_receive_port_destroy(virqs[i]); ps3_event_receive_port_destroy(virqs[i]);
virqs[i] = NO_IRQ; virqs[i] = 0;
} }
DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu); DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu);

View File

@ -284,7 +284,7 @@ fail_alloc_2:
fail_alloc_1: fail_alloc_1:
ps3_spe_irq_destroy(spu->irqs[0]); ps3_spe_irq_destroy(spu->irqs[0]);
fail_alloc_0: fail_alloc_0:
spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = NO_IRQ; spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = 0;
return result; return result;
} }
@ -334,7 +334,7 @@ static int ps3_destroy_spu(struct spu *spu)
ps3_spe_irq_destroy(spu->irqs[1]); ps3_spe_irq_destroy(spu->irqs[1]);
ps3_spe_irq_destroy(spu->irqs[0]); ps3_spe_irq_destroy(spu->irqs[0]);
spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = NO_IRQ; spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = 0;
spu_unmap(spu); spu_unmap(spu);

View File

@ -34,7 +34,7 @@ void request_event_sources_irqs(struct device_node *np,
if (count > 15) if (count > 15)
break; break;
virqs[count] = irq_create_of_mapping(&oirq); virqs[count] = irq_create_of_mapping(&oirq);
if (virqs[count] == NO_IRQ) { if (!virqs[count]) {
pr_err("event-sources: Unable to allocate " pr_err("event-sources: Unable to allocate "
"interrupt number for %s\n", "interrupt number for %s\n",
np->full_name); np->full_name);

View File

@ -119,7 +119,7 @@ static void rtas_teardown_msi_irqs(struct pci_dev *pdev)
struct msi_desc *entry; struct msi_desc *entry;
for_each_pci_msi_entry(entry, pdev) { for_each_pci_msi_entry(entry, pdev) {
if (entry->irq == NO_IRQ) if (!entry->irq)
continue; continue;
irq_set_msi_desc(entry->irq, NULL); irq_set_msi_desc(entry->irq, NULL);
@ -471,7 +471,7 @@ again:
virq = irq_create_mapping(NULL, hwirq); virq = irq_create_mapping(NULL, hwirq);
if (virq == NO_IRQ) { if (!virq) {
pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq); pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq);
return -ENOSPC; return -ENOSPC;
} }
@ -490,7 +490,7 @@ again:
static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev) static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev)
{ {
/* No LSI -> leave MSIs (if any) configured */ /* No LSI -> leave MSIs (if any) configured */
if (pdev->irq == NO_IRQ) { if (!pdev->irq) {
dev_dbg(&pdev->dev, "rtas_msi: no LSI, nothing to do.\n"); dev_dbg(&pdev->dev, "rtas_msi: no LSI, nothing to do.\n");
return; return;
} }

View File

@ -114,7 +114,7 @@ static void pseries_8259_cascade(struct irq_desc *desc)
struct irq_chip *chip = irq_desc_get_chip(desc); struct irq_chip *chip = irq_desc_get_chip(desc);
unsigned int cascade_irq = i8259_irq(); unsigned int cascade_irq = i8259_irq();
if (cascade_irq != NO_IRQ) if (cascade_irq)
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
chip->irq_eoi(&desc->irq_data); chip->irq_eoi(&desc->irq_data);
@ -141,7 +141,7 @@ static void __init pseries_setup_i8259_cascade(void)
} }
cascade = irq_of_parse_and_map(found, 0); cascade = irq_of_parse_and_map(found, 0);
if (cascade == NO_IRQ) { if (!cascade) {
printk(KERN_ERR "pic: failed to map cascade interrupt"); printk(KERN_ERR "pic: failed to map cascade interrupt");
return; return;
} }

View File

@ -240,7 +240,7 @@ static int axon_ram_probe(struct platform_device *device)
device_add_disk(&device->dev, bank->disk); device_add_disk(&device->dev, bank->disk);
bank->irq_id = irq_of_parse_and_map(device->dev.of_node, 0); bank->irq_id = irq_of_parse_and_map(device->dev.of_node, 0);
if (bank->irq_id == NO_IRQ) { if (!bank->irq_id) {
dev_err(&device->dev, "Cannot access ECC interrupt ID\n"); dev_err(&device->dev, "Cannot access ECC interrupt ID\n");
rc = -EFAULT; rc = -EFAULT;
goto failed; goto failed;
@ -250,7 +250,7 @@ static int axon_ram_probe(struct platform_device *device)
AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device); AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device);
if (rc != 0) { if (rc != 0) {
dev_err(&device->dev, "Cannot register ECC interrupt handler\n"); dev_err(&device->dev, "Cannot register ECC interrupt handler\n");
bank->irq_id = NO_IRQ; bank->irq_id = 0;
rc = -EFAULT; rc = -EFAULT;
goto failed; goto failed;
} }
@ -268,7 +268,7 @@ static int axon_ram_probe(struct platform_device *device)
failed: failed:
if (bank != NULL) { if (bank != NULL) {
if (bank->irq_id != NO_IRQ) if (bank->irq_id)
free_irq(bank->irq_id, device); free_irq(bank->irq_id, device);
if (bank->disk != NULL) { if (bank->disk != NULL) {
if (bank->disk->major > 0) if (bank->disk->major > 0)

View File

@ -132,7 +132,7 @@ unsigned int cpm_pic_init(void)
{ {
struct device_node *np = NULL; struct device_node *np = NULL;
struct resource res; struct resource res;
unsigned int sirq = NO_IRQ, hwirq, eirq; unsigned int sirq = 0, hwirq, eirq;
int ret; int ret;
pr_debug("cpm_pic_init\n"); pr_debug("cpm_pic_init\n");
@ -154,7 +154,7 @@ unsigned int cpm_pic_init(void)
goto end; goto end;
sirq = irq_of_parse_and_map(np, 0); sirq = irq_of_parse_and_map(np, 0);
if (sirq == NO_IRQ) if (!sirq)
goto end; goto end;
/* Initialize the CPM interrupt controller. */ /* Initialize the CPM interrupt controller. */
@ -168,7 +168,7 @@ unsigned int cpm_pic_init(void)
cpm_pic_host = irq_domain_add_linear(np, 64, &cpm_pic_host_ops, NULL); cpm_pic_host = irq_domain_add_linear(np, 64, &cpm_pic_host_ops, NULL);
if (cpm_pic_host == NULL) { if (cpm_pic_host == NULL) {
printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n");
sirq = NO_IRQ; sirq = 0;
goto end; goto end;
} }
@ -182,7 +182,7 @@ unsigned int cpm_pic_init(void)
} }
eirq = irq_of_parse_and_map(np, 0); eirq = irq_of_parse_and_map(np, 0);
if (eirq == NO_IRQ) if (!eirq)
goto end; goto end;
if (setup_irq(eirq, &cpm_error_irqaction)) if (setup_irq(eirq, &cpm_error_irqaction))

View File

@ -155,7 +155,7 @@ static struct irq_chip ehv_pic_direct_eoi_irq_chip = {
.irq_set_type = ehv_pic_set_irq_type, .irq_set_type = ehv_pic_set_irq_type,
}; };
/* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ /* Return an interrupt vector or 0 if no interrupt is pending. */
unsigned int ehv_pic_get_irq(void) unsigned int ehv_pic_get_irq(void)
{ {
int irq; int irq;
@ -168,7 +168,7 @@ unsigned int ehv_pic_get_irq(void)
ev_int_iack(0, &irq); /* legacy mode */ ev_int_iack(0, &irq); /* legacy mode */
if (irq == 0xFFFF) /* 0xFFFF --> no irq is pending */ if (irq == 0xFFFF) /* 0xFFFF --> no irq is pending */
return NO_IRQ; return 0;
/* /*
* this will also setup revmap[] in the slow path for the first * this will also setup revmap[] in the slow path for the first

View File

@ -406,7 +406,7 @@ static int __init fsl_gtm_init(void)
unsigned int irq; unsigned int irq;
irq = irq_of_parse_and_map(np, i); irq = irq_of_parse_and_map(np, i);
if (irq == NO_IRQ) { if (!irq) {
pr_err("%s: not enough interrupts specified\n", pr_err("%s: not enough interrupts specified\n",
np->full_name); np->full_name);
goto err; goto err;

View File

@ -115,8 +115,8 @@ static irqreturn_t fsl_error_int_handler(int irq, void *data)
errint = __builtin_clz(eisr); errint = __builtin_clz(eisr);
cascade_irq = irq_linear_revmap(mpic->irqhost, cascade_irq = irq_linear_revmap(mpic->irqhost,
mpic->err_int_vecs[errint]); mpic->err_int_vecs[errint]);
WARN_ON(cascade_irq == NO_IRQ); WARN_ON(!cascade_irq);
if (cascade_irq != NO_IRQ) { if (cascade_irq) {
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
} else { } else {
eimr |= 1 << (31 - errint); eimr |= 1 << (31 - errint);
@ -134,7 +134,7 @@ void mpic_err_int_init(struct mpic *mpic, irq_hw_number_t irqnum)
int ret; int ret;
virq = irq_create_mapping(mpic->irqhost, irqnum); virq = irq_create_mapping(mpic->irqhost, irqnum);
if (virq == NO_IRQ) { if (!virq) {
pr_err("Error interrupt setup failed\n"); pr_err("Error interrupt setup failed\n");
return; return;
} }

View File

@ -131,7 +131,7 @@ static void fsl_teardown_msi_irqs(struct pci_dev *pdev)
irq_hw_number_t hwirq; irq_hw_number_t hwirq;
for_each_pci_msi_entry(entry, pdev) { for_each_pci_msi_entry(entry, pdev) {
if (entry->irq == NO_IRQ) if (!entry->irq)
continue; continue;
hwirq = virq_to_hw(entry->irq); hwirq = virq_to_hw(entry->irq);
msi_data = irq_get_chip_data(entry->irq); msi_data = irq_get_chip_data(entry->irq);
@ -250,7 +250,7 @@ static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
virq = irq_create_mapping(msi_data->irqhost, hwirq); virq = irq_create_mapping(msi_data->irqhost, hwirq);
if (virq == NO_IRQ) { if (!virq) {
dev_err(&pdev->dev, "fail mapping hwirq %i\n", hwirq); dev_err(&pdev->dev, "fail mapping hwirq %i\n", hwirq);
msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1); msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1);
rc = -ENOSPC; rc = -ENOSPC;
@ -285,7 +285,7 @@ static irqreturn_t fsl_msi_cascade(int irq, void *data)
msir_index = cascade_data->index; msir_index = cascade_data->index;
if (msir_index >= NR_MSI_REG_MAX) if (msir_index >= NR_MSI_REG_MAX)
cascade_irq = NO_IRQ; cascade_irq = 0;
switch (msi_data->feature & FSL_PIC_IP_MASK) { switch (msi_data->feature & FSL_PIC_IP_MASK) {
case FSL_PIC_IP_MPIC: case FSL_PIC_IP_MPIC:
@ -315,7 +315,7 @@ static irqreturn_t fsl_msi_cascade(int irq, void *data)
cascade_irq = irq_linear_revmap(msi_data->irqhost, cascade_irq = irq_linear_revmap(msi_data->irqhost,
msi_hwirq(msi_data, msir_index, msi_hwirq(msi_data, msir_index,
intr_index + have_shift)); intr_index + have_shift));
if (cascade_irq != NO_IRQ) { if (cascade_irq) {
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
ret = IRQ_HANDLED; ret = IRQ_HANDLED;
} }
@ -337,7 +337,7 @@ static int fsl_of_msi_remove(struct platform_device *ofdev)
if (msi->cascade_array[i]) { if (msi->cascade_array[i]) {
virq = msi->cascade_array[i]->virq; virq = msi->cascade_array[i]->virq;
BUG_ON(virq == NO_IRQ); BUG_ON(!virq);
free_irq(virq, msi->cascade_array[i]); free_irq(virq, msi->cascade_array[i]);
kfree(msi->cascade_array[i]); kfree(msi->cascade_array[i]);
@ -362,7 +362,7 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct platform_device *dev,
int virt_msir, i, ret; int virt_msir, i, ret;
virt_msir = irq_of_parse_and_map(dev->dev.of_node, irq_index); virt_msir = irq_of_parse_and_map(dev->dev.of_node, irq_index);
if (virt_msir == NO_IRQ) { if (!virt_msir) {
dev_err(&dev->dev, "%s: Cannot translate IRQ index %d\n", dev_err(&dev->dev, "%s: Cannot translate IRQ index %d\n",
__func__, irq_index); __func__, irq_index);
return 0; return 0;

View File

@ -102,7 +102,7 @@ static void gef_pic_cascade(struct irq_desc *desc)
*/ */
cascade_irq = gef_pic_get_irq(); cascade_irq = gef_pic_get_irq();
if (cascade_irq != NO_IRQ) if (cascade_irq)
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
chip->irq_eoi(&desc->irq_data); chip->irq_eoi(&desc->irq_data);
@ -206,7 +206,7 @@ void __init gef_pic_init(struct device_node *np)
/* Map controller */ /* Map controller */
gef_pic_cascade_irq = irq_of_parse_and_map(np, 0); gef_pic_cascade_irq = irq_of_parse_and_map(np, 0);
if (gef_pic_cascade_irq == NO_IRQ) { if (!gef_pic_cascade_irq) {
printk(KERN_ERR "SBC610: failed to map cascade interrupt"); printk(KERN_ERR "SBC610: failed to map cascade interrupt");
return; return;
} }
@ -223,12 +223,12 @@ void __init gef_pic_init(struct device_node *np)
/* /*
* This is called when we receive an interrupt with apparently comes from this * This is called when we receive an interrupt with apparently comes from this
* chip - check, returning the highest interrupt generated or return NO_IRQ * chip - check, returning the highest interrupt generated or return 0.
*/ */
unsigned int gef_pic_get_irq(void) unsigned int gef_pic_get_irq(void)
{ {
u32 cause, mask, active; u32 cause, mask, active;
unsigned int virq = NO_IRQ; unsigned int virq = 0;
int hwirq; int hwirq;
cause = in_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_STATUS); cause = in_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_STATUS);

View File

@ -68,9 +68,9 @@ unsigned int i8259_irq(void)
if (!pci_intack) if (!pci_intack)
outb(0x0B, 0x20); /* ISR register */ outb(0x0B, 0x20); /* ISR register */
if(~inb(0x20) & 0x80) if(~inb(0x20) & 0x80)
irq = NO_IRQ; irq = 0;
} else if (irq == 0xff) } else if (irq == 0xff)
irq = NO_IRQ; irq = 0;
if (lock) if (lock)
raw_spin_unlock(&i8259_lock); raw_spin_unlock(&i8259_lock);

View File

@ -853,7 +853,7 @@ void ipic_clear_mcp_status(u32 mask)
ipic_write(primary_ipic->regs, IPIC_SERMR, mask); ipic_write(primary_ipic->regs, IPIC_SERMR, mask);
} }
/* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ /* Return an interrupt vector or 0 if no interrupt is pending. */
unsigned int ipic_get_irq(void) unsigned int ipic_get_irq(void)
{ {
int irq; int irq;
@ -864,7 +864,7 @@ unsigned int ipic_get_irq(void)
irq = ipic_read(primary_ipic->regs, IPIC_SIVCR) & IPIC_SIVCR_VECTOR_MASK; irq = ipic_read(primary_ipic->regs, IPIC_SIVCR) & IPIC_SIVCR_VECTOR_MASK;
if (irq == 0) /* 0 --> no irq is pending */ if (irq == 0) /* 0 --> no irq is pending */
return NO_IRQ; return 0;
return irq_linear_revmap(primary_ipic->irqhost, irq); return irq_linear_revmap(primary_ipic->irqhost, irq);
} }

View File

@ -79,7 +79,7 @@ unsigned int mpc8xx_get_irq(void)
irq = in_be32(&siu_reg->sc_sivec) >> 26; irq = in_be32(&siu_reg->sc_sivec) >> 26;
if (irq == PIC_VEC_SPURRIOUS) if (irq == PIC_VEC_SPURRIOUS)
irq = NO_IRQ; irq = 0;
return irq_linear_revmap(mpc8xx_pic_host, irq); return irq_linear_revmap(mpc8xx_pic_host, irq);

View File

@ -1649,7 +1649,7 @@ void __init mpic_init(struct mpic *mpic)
/* Check if this MPIC is chained from a parent interrupt controller */ /* Check if this MPIC is chained from a parent interrupt controller */
if (mpic->flags & MPIC_SECONDARY) { if (mpic->flags & MPIC_SECONDARY) {
int virq = irq_of_parse_and_map(mpic->node, 0); int virq = irq_of_parse_and_map(mpic->node, 0);
if (virq != NO_IRQ) { if (virq) {
printk(KERN_INFO "%s: hooking up to IRQ %d\n", printk(KERN_INFO "%s: hooking up to IRQ %d\n",
mpic->node->full_name, virq); mpic->node->full_name, virq);
irq_set_handler_data(virq, mpic); irq_set_handler_data(virq, mpic);
@ -1778,13 +1778,13 @@ static unsigned int _mpic_get_one_irq(struct mpic *mpic, int reg)
if (unlikely(src == mpic->spurious_vec)) { if (unlikely(src == mpic->spurious_vec)) {
if (mpic->flags & MPIC_SPV_EOI) if (mpic->flags & MPIC_SPV_EOI)
mpic_eoi(mpic); mpic_eoi(mpic);
return NO_IRQ; return 0;
} }
if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n", printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n",
mpic->name, (int)src); mpic->name, (int)src);
mpic_eoi(mpic); mpic_eoi(mpic);
return NO_IRQ; return 0;
} }
return irq_linear_revmap(mpic->irqhost, src); return irq_linear_revmap(mpic->irqhost, src);
@ -1817,17 +1817,17 @@ unsigned int mpic_get_coreint_irq(void)
if (unlikely(src == mpic->spurious_vec)) { if (unlikely(src == mpic->spurious_vec)) {
if (mpic->flags & MPIC_SPV_EOI) if (mpic->flags & MPIC_SPV_EOI)
mpic_eoi(mpic); mpic_eoi(mpic);
return NO_IRQ; return 0;
} }
if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n", printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n",
mpic->name, (int)src); mpic->name, (int)src);
return NO_IRQ; return 0;
} }
return irq_linear_revmap(mpic->irqhost, src); return irq_linear_revmap(mpic->irqhost, src);
#else #else
return NO_IRQ; return 0;
#endif #endif
} }
@ -1852,7 +1852,7 @@ void mpic_request_ipis(void)
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
unsigned int vipi = irq_create_mapping(mpic->irqhost, unsigned int vipi = irq_create_mapping(mpic->irqhost,
mpic->ipi_vecs[0] + i); mpic->ipi_vecs[0] + i);
if (vipi == NO_IRQ) { if (!vipi) {
printk(KERN_ERR "Failed to map %s\n", smp_ipi_name[i]); printk(KERN_ERR "Failed to map %s\n", smp_ipi_name[i]);
continue; continue;
} }

View File

@ -238,7 +238,7 @@ static int mpic_msgr_probe(struct platform_device *dev)
if (receive_mask & (1 << i)) { if (receive_mask & (1 << i)) {
msgr->irq = irq_of_parse_and_map(np, irq_index); msgr->irq = irq_of_parse_and_map(np, irq_index);
if (msgr->irq == NO_IRQ) { if (!msgr->irq) {
dev_err(&dev->dev, dev_err(&dev->dev,
"Missing interrupt specifier"); "Missing interrupt specifier");
kfree(msgr); kfree(msgr);
@ -246,7 +246,7 @@ static int mpic_msgr_probe(struct platform_device *dev)
} }
irq_index += 1; irq_index += 1;
} else { } else {
msgr->irq = NO_IRQ; msgr->irq = 0;
} }
mpic_msgrs[reg_number] = msgr; mpic_msgrs[reg_number] = msgr;

View File

@ -110,7 +110,7 @@ static void u3msi_teardown_msi_irqs(struct pci_dev *pdev)
irq_hw_number_t hwirq; irq_hw_number_t hwirq;
for_each_pci_msi_entry(entry, pdev) { for_each_pci_msi_entry(entry, pdev) {
if (entry->irq == NO_IRQ) if (!entry->irq)
continue; continue;
hwirq = virq_to_hw(entry->irq); hwirq = virq_to_hw(entry->irq);
@ -155,7 +155,7 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
msg.address_hi = addr >> 32; msg.address_hi = addr >> 32;
virq = irq_create_mapping(msi_mpic->irqhost, hwirq); virq = irq_create_mapping(msi_mpic->irqhost, hwirq);
if (virq == NO_IRQ) { if (!virq) {
pr_debug("u3msi: failed mapping hwirq 0x%x\n", hwirq); pr_debug("u3msi: failed mapping hwirq 0x%x\n", hwirq);
msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1); msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1);
return -ENOSPC; return -ENOSPC;

View File

@ -272,7 +272,7 @@ unsigned int mv64x60_get_irq(void)
u32 cause; u32 cause;
int level1; int level1;
irq_hw_number_t hwirq; irq_hw_number_t hwirq;
int virq = NO_IRQ; int virq = 0;
cause = in_le32(mv64x60_irq_reg_base + MV64X60_IC_CPU0_SELECT_CAUSE); cause = in_le32(mv64x60_irq_reg_base + MV64X60_IC_CPU0_SELECT_CAUSE);
if (cause & MV64X60_SELECT_CAUSE_HIGH) { if (cause & MV64X60_SELECT_CAUSE_HIGH) {

View File

@ -158,7 +158,7 @@ static int pmi_of_probe(struct platform_device *dev)
data->dev = dev; data->dev = dev;
data->irq = irq_of_parse_and_map(np, 0); data->irq = irq_of_parse_and_map(np, 0);
if (data->irq == NO_IRQ) { if (!data->irq) {
printk(KERN_ERR "pmi: invalid interrupt.\n"); printk(KERN_ERR "pmi: invalid interrupt.\n");
rc = -EFAULT; rc = -EFAULT;
goto error_cleanup_iomap; goto error_cleanup_iomap;

View File

@ -60,7 +60,7 @@ static int hsta_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
} }
hwirq = ppc4xx_hsta_msi.irq_map[irq]; hwirq = ppc4xx_hsta_msi.irq_map[irq];
if (hwirq == NO_IRQ) { if (!hwirq) {
pr_err("%s: Failed mapping irq %d\n", __func__, irq); pr_err("%s: Failed mapping irq %d\n", __func__, irq);
return -EINVAL; return -EINVAL;
} }
@ -110,7 +110,7 @@ static void hsta_teardown_msi_irqs(struct pci_dev *dev)
int irq; int irq;
for_each_pci_msi_entry(entry, dev) { for_each_pci_msi_entry(entry, dev) {
if (entry->irq == NO_IRQ) if (!entry->irq)
continue; continue;
irq = hsta_find_hwirq_offset(entry->irq); irq = hsta_find_hwirq_offset(entry->irq);
@ -166,7 +166,7 @@ static int hsta_msi_probe(struct platform_device *pdev)
for (irq = 0; irq < irq_count; irq++) { for (irq = 0; irq < irq_count; irq++) {
ppc4xx_hsta_msi.irq_map[irq] = ppc4xx_hsta_msi.irq_map[irq] =
irq_of_parse_and_map(dev->of_node, irq); irq_of_parse_and_map(dev->of_node, irq);
if (ppc4xx_hsta_msi.irq_map[irq] == NO_IRQ) { if (!ppc4xx_hsta_msi.irq_map[irq]) {
dev_err(dev, "Unable to map IRQ\n"); dev_err(dev, "Unable to map IRQ\n");
ret = -EINVAL; ret = -EINVAL;
goto out2; goto out2;

View File

@ -102,7 +102,7 @@ static int ppc4xx_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
__func__); __func__);
} }
virq = irq_of_parse_and_map(msi_data->msi_dev, int_no); virq = irq_of_parse_and_map(msi_data->msi_dev, int_no);
if (virq == NO_IRQ) { if (!virq) {
dev_err(&dev->dev, "%s: fail mapping irq\n", __func__); dev_err(&dev->dev, "%s: fail mapping irq\n", __func__);
msi_bitmap_free_hwirqs(&msi_data->bitmap, int_no, 1); msi_bitmap_free_hwirqs(&msi_data->bitmap, int_no, 1);
return -ENOSPC; return -ENOSPC;
@ -129,7 +129,7 @@ void ppc4xx_teardown_msi_irqs(struct pci_dev *dev)
dev_dbg(&dev->dev, "PCIE-MSI: tearing down msi irqs\n"); dev_dbg(&dev->dev, "PCIE-MSI: tearing down msi irqs\n");
for_each_pci_msi_entry(entry, dev) { for_each_pci_msi_entry(entry, dev) {
if (entry->irq == NO_IRQ) if (!entry->irq)
continue; continue;
hwirq = virq_to_hw(entry->irq); hwirq = virq_to_hw(entry->irq);
irq_set_msi_desc(entry->irq, NULL); irq_set_msi_desc(entry->irq, NULL);
@ -201,7 +201,7 @@ static int ppc4xx_of_msi_remove(struct platform_device *dev)
for (i = 0; i < msi_irqs; i++) { for (i = 0; i < msi_irqs; i++) {
virq = msi->msi_virqs[i]; virq = msi->msi_virqs[i];
if (virq != NO_IRQ) if (virq)
irq_dispose_mapping(virq); irq_dispose_mapping(virq);
} }

View File

@ -109,7 +109,7 @@ static int __init ppc4xx_l2c_probe(void)
/* Get and map irq number from device tree */ /* Get and map irq number from device tree */
irq = irq_of_parse_and_map(np, 0); irq = irq_of_parse_and_map(np, 0);
if (irq == NO_IRQ) { if (!irq) {
printk(KERN_ERR "irq_of_parse_and_map failed\n"); printk(KERN_ERR "irq_of_parse_and_map failed\n");
of_node_put(np); of_node_put(np);
return -ENODEV; return -ENODEV;

View File

@ -433,7 +433,7 @@ void tsi108_irq_cascade(struct irq_desc *desc)
struct irq_chip *chip = irq_desc_get_chip(desc); struct irq_chip *chip = irq_desc_get_chip(desc);
unsigned int cascade_irq = get_pci_source(); unsigned int cascade_irq = get_pci_source();
if (cascade_irq != NO_IRQ) if (cascade_irq)
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
chip->irq_eoi(&desc->irq_data); chip->irq_eoi(&desc->irq_data);

View File

@ -319,7 +319,7 @@ void __init uic_init_tree(void)
} }
} }
/* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ /* Return an interrupt vector or 0 if no interrupt is pending. */
unsigned int uic_get_irq(void) unsigned int uic_get_irq(void)
{ {
u32 msr; u32 msr;

View File

@ -112,10 +112,10 @@ static unsigned int icp_hv_get_irq(void)
unsigned int irq; unsigned int irq;
if (vec == XICS_IRQ_SPURIOUS) if (vec == XICS_IRQ_SPURIOUS)
return NO_IRQ; return 0;
irq = irq_find_mapping(xics_host, vec); irq = irq_find_mapping(xics_host, vec);
if (likely(irq != NO_IRQ)) { if (likely(irq)) {
xics_push_cppr(vec); xics_push_cppr(vec);
return irq; return irq;
} }
@ -126,7 +126,7 @@ static unsigned int icp_hv_get_irq(void)
/* We might learn about it later, so EOI it */ /* We might learn about it later, so EOI it */
icp_hv_set_xirr(xirr); icp_hv_set_xirr(xirr);
return NO_IRQ; return 0;
} }
static void icp_hv_set_cpu_priority(unsigned char cppr) static void icp_hv_set_cpu_priority(unsigned char cppr)

View File

@ -124,10 +124,10 @@ static unsigned int icp_native_get_irq(void)
unsigned int irq; unsigned int irq;
if (vec == XICS_IRQ_SPURIOUS) if (vec == XICS_IRQ_SPURIOUS)
return NO_IRQ; return 0;
irq = irq_find_mapping(xics_host, vec); irq = irq_find_mapping(xics_host, vec);
if (likely(irq != NO_IRQ)) { if (likely(irq)) {
xics_push_cppr(vec); xics_push_cppr(vec);
return irq; return irq;
} }
@ -138,7 +138,7 @@ static unsigned int icp_native_get_irq(void)
/* We might learn about it later, so EOI it */ /* We might learn about it later, so EOI it */
icp_native_set_xirr(xirr); icp_native_set_xirr(xirr);
return NO_IRQ; return 0;
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP

View File

@ -51,14 +51,14 @@ static unsigned int icp_opal_get_irq(void)
rc = opal_int_get_xirr(&xirr, false); rc = opal_int_get_xirr(&xirr, false);
if (rc < 0) if (rc < 0)
return NO_IRQ; return 0;
xirr = be32_to_cpu(xirr); xirr = be32_to_cpu(xirr);
vec = xirr & 0x00ffffff; vec = xirr & 0x00ffffff;
if (vec == XICS_IRQ_SPURIOUS) if (vec == XICS_IRQ_SPURIOUS)
return NO_IRQ; return 0;
irq = irq_find_mapping(xics_host, vec); irq = irq_find_mapping(xics_host, vec);
if (likely(irq != NO_IRQ)) { if (likely(irq)) {
xics_push_cppr(vec); xics_push_cppr(vec);
return irq; return irq;
} }
@ -69,7 +69,7 @@ static unsigned int icp_opal_get_irq(void)
/* We might learn about it later, so EOI it */ /* We might learn about it later, so EOI it */
opal_int_eoi(xirr); opal_int_eoi(xirr);
return NO_IRQ; return 0;
} }
static void icp_opal_set_cpu_priority(unsigned char cppr) static void icp_opal_set_cpu_priority(unsigned char cppr)

View File

@ -131,7 +131,7 @@ static void xics_request_ipi(void)
unsigned int ipi; unsigned int ipi;
ipi = irq_create_mapping(xics_host, XICS_IPI); ipi = irq_create_mapping(xics_host, XICS_IPI);
BUG_ON(ipi == NO_IRQ); BUG_ON(!ipi);
/* /*
* IPIs are marked IRQF_PERCPU. The handler was set in map. * IPIs are marked IRQF_PERCPU. The handler was set in map.

View File

@ -236,7 +236,7 @@ static void macio_create_fixup_irq(struct macio_dev *dev, int index,
unsigned int irq; unsigned int irq;
irq = irq_create_mapping(NULL, line); irq = irq_create_mapping(NULL, line);
if (irq != NO_IRQ) { if (!irq) {
dev->interrupt[index].start = irq; dev->interrupt[index].start = irq;
dev->interrupt[index].flags = IORESOURCE_IRQ; dev->interrupt[index].flags = IORESOURCE_IRQ;
dev->interrupt[index].name = dev_name(&dev->ofdev.dev); dev->interrupt[index].name = dev_name(&dev->ofdev.dev);
@ -299,7 +299,7 @@ static void macio_setup_interrupts(struct macio_dev *dev)
break; break;
res = &dev->interrupt[j]; res = &dev->interrupt[j];
irq = irq_of_parse_and_map(np, i++); irq = irq_of_parse_and_map(np, i++);
if (irq == NO_IRQ) if (!irq)
break; break;
res->start = irq; res->start = irq;
res->flags = IORESOURCE_IRQ; res->flags = IORESOURCE_IRQ;

View File

@ -427,7 +427,7 @@ static int rackmeter_probe(struct macio_dev* mdev,
rm->irq = macio_irq(mdev, 1); rm->irq = macio_irq(mdev, 1);
#else #else
rm->irq = irq_of_parse_and_map(i2s, 1); rm->irq = irq_of_parse_and_map(i2s, 1);
if (rm->irq == NO_IRQ || if (!rm->irq ||
of_address_to_resource(i2s, 0, &ri2s) || of_address_to_resource(i2s, 0, &ri2s) ||
of_address_to_resource(i2s, 1, &rdma)) { of_address_to_resource(i2s, 1, &rdma)) {
printk(KERN_ERR printk(KERN_ERR

View File

@ -279,7 +279,7 @@ int smu_queue_cmd(struct smu_cmd *cmd)
spin_unlock_irqrestore(&smu->lock, flags); spin_unlock_irqrestore(&smu->lock, flags);
/* Workaround for early calls when irq isn't available */ /* Workaround for early calls when irq isn't available */
if (!smu_irq_inited || smu->db_irq == NO_IRQ) if (!smu_irq_inited || !smu->db_irq)
smu_spinwait_cmd(cmd); smu_spinwait_cmd(cmd);
return 0; return 0;
@ -498,8 +498,8 @@ int __init smu_init (void)
INIT_LIST_HEAD(&smu->cmd_list); INIT_LIST_HEAD(&smu->cmd_list);
INIT_LIST_HEAD(&smu->cmd_i2c_list); INIT_LIST_HEAD(&smu->cmd_i2c_list);
smu->of_node = np; smu->of_node = np;
smu->db_irq = NO_IRQ; smu->db_irq = 0;
smu->msg_irq = NO_IRQ; smu->msg_irq = 0;
/* smu_cmdbuf_abs is in the low 2G of RAM, can be converted to a /* smu_cmdbuf_abs is in the low 2G of RAM, can be converted to a
* 32 bits value safely * 32 bits value safely
@ -587,13 +587,13 @@ static int smu_late_init(void)
if (smu->db_node) { if (smu->db_node) {
smu->db_irq = irq_of_parse_and_map(smu->db_node, 0); smu->db_irq = irq_of_parse_and_map(smu->db_node, 0);
if (smu->db_irq == NO_IRQ) if (!smu->db_irq)
printk(KERN_ERR "smu: failed to map irq for node %s\n", printk(KERN_ERR "smu: failed to map irq for node %s\n",
smu->db_node->full_name); smu->db_node->full_name);
} }
if (smu->msg_node) { if (smu->msg_node) {
smu->msg_irq = irq_of_parse_and_map(smu->msg_node, 0); smu->msg_irq = irq_of_parse_and_map(smu->msg_node, 0);
if (smu->msg_irq == NO_IRQ) if (!smu->msg_irq)
printk(KERN_ERR "smu: failed to map irq for node %s\n", printk(KERN_ERR "smu: failed to map irq for node %s\n",
smu->msg_node->full_name); smu->msg_node->full_name);
} }
@ -602,23 +602,23 @@ static int smu_late_init(void)
* Try to request the interrupts * Try to request the interrupts
*/ */
if (smu->db_irq != NO_IRQ) { if (smu->db_irq) {
if (request_irq(smu->db_irq, smu_db_intr, if (request_irq(smu->db_irq, smu_db_intr,
IRQF_SHARED, "SMU doorbell", smu) < 0) { IRQF_SHARED, "SMU doorbell", smu) < 0) {
printk(KERN_WARNING "SMU: can't " printk(KERN_WARNING "SMU: can't "
"request interrupt %d\n", "request interrupt %d\n",
smu->db_irq); smu->db_irq);
smu->db_irq = NO_IRQ; smu->db_irq = 0;
} }
} }
if (smu->msg_irq != NO_IRQ) { if (smu->msg_irq) {
if (request_irq(smu->msg_irq, smu_msg_intr, if (request_irq(smu->msg_irq, smu_msg_intr,
IRQF_SHARED, "SMU message", smu) < 0) { IRQF_SHARED, "SMU message", smu) < 0) {
printk(KERN_WARNING "SMU: can't " printk(KERN_WARNING "SMU: can't "
"request interrupt %d\n", "request interrupt %d\n",
smu->msg_irq); smu->msg_irq);
smu->msg_irq = NO_IRQ; smu->msg_irq = 0;
} }
} }

View File

@ -209,7 +209,7 @@ static int __init via_cuda_start(void)
cuda_irq = IRQ_MAC_ADB; cuda_irq = IRQ_MAC_ADB;
#else #else
cuda_irq = irq_of_parse_and_map(vias, 0); cuda_irq = irq_of_parse_and_map(vias, 0);
if (cuda_irq == NO_IRQ) { if (!cuda_irq) {
printk(KERN_ERR "via-cuda: can't map interrupts for %s\n", printk(KERN_ERR "via-cuda: can't map interrupts for %s\n",
vias->full_name); vias->full_name);
return -ENODEV; return -ENODEV;

View File

@ -145,7 +145,7 @@ static int pmu_fully_inited;
static int pmu_has_adb; static int pmu_has_adb;
static struct device_node *gpio_node; static struct device_node *gpio_node;
static unsigned char __iomem *gpio_reg; static unsigned char __iomem *gpio_reg;
static int gpio_irq = NO_IRQ; static int gpio_irq = 0;
static int gpio_irq_enabled = -1; static int gpio_irq_enabled = -1;
static volatile int pmu_suspended; static volatile int pmu_suspended;
static spinlock_t pmu_lock; static spinlock_t pmu_lock;
@ -402,7 +402,7 @@ static int __init via_pmu_start(void)
batt_req.complete = 1; batt_req.complete = 1;
irq = irq_of_parse_and_map(vias, 0); irq = irq_of_parse_and_map(vias, 0);
if (irq == NO_IRQ) { if (!irq) {
printk(KERN_ERR "via-pmu: can't map interrupt\n"); printk(KERN_ERR "via-pmu: can't map interrupt\n");
return -ENODEV; return -ENODEV;
} }
@ -424,7 +424,7 @@ static int __init via_pmu_start(void)
if (gpio_node) if (gpio_node)
gpio_irq = irq_of_parse_and_map(gpio_node, 0); gpio_irq = irq_of_parse_and_map(gpio_node, 0);
if (gpio_irq != NO_IRQ) { if (gpio_irq) {
if (request_irq(gpio_irq, gpio1_interrupt, if (request_irq(gpio_irq, gpio1_interrupt,
IRQF_NO_SUSPEND, "GPIO1 ADB", IRQF_NO_SUSPEND, "GPIO1 ADB",
(void *)0)) (void *)0))

View File

@ -958,7 +958,7 @@ static int ps3_vuart_bus_interrupt_get(void)
fail_request_irq: fail_request_irq:
ps3_vuart_irq_destroy(vuart_bus_priv.virq); ps3_vuart_irq_destroy(vuart_bus_priv.virq);
vuart_bus_priv.virq = NO_IRQ; vuart_bus_priv.virq = 0;
fail_alloc_irq: fail_alloc_irq:
kfree(vuart_bus_priv.bmp); kfree(vuart_bus_priv.bmp);
vuart_bus_priv.bmp = NULL; vuart_bus_priv.bmp = NULL;
@ -982,7 +982,7 @@ static int ps3_vuart_bus_interrupt_put(void)
free_irq(vuart_bus_priv.virq, &vuart_bus_priv); free_irq(vuart_bus_priv.virq, &vuart_bus_priv);
ps3_vuart_irq_destroy(vuart_bus_priv.virq); ps3_vuart_irq_destroy(vuart_bus_priv.virq);
vuart_bus_priv.virq = NO_IRQ; vuart_bus_priv.virq = 0;
kfree(vuart_bus_priv.bmp); kfree(vuart_bus_priv.bmp);
vuart_bus_priv.bmp = NULL; vuart_bus_priv.bmp = NULL;

View File

@ -118,7 +118,7 @@ static void get_irq(struct device_node * np, int *irqptr)
if (np) if (np)
*irqptr = irq_of_parse_and_map(np, 0); *irqptr = irq_of_parse_and_map(np, 0);
else else
*irqptr = NO_IRQ; *irqptr = 0;
} }
/* 0x4 is outenable, 0x1 is out, thus 4 or 5 */ /* 0x4 is outenable, 0x1 is out, thus 4 or 5 */
@ -336,7 +336,7 @@ static int ftr_set_notify(struct gpio_runtime *rt,
return -EINVAL; return -EINVAL;
} }
if (irq == NO_IRQ) if (!irq)
return -ENODEV; return -ENODEV;
mutex_lock(&notif->mutex); mutex_lock(&notif->mutex);

View File

@ -1303,19 +1303,19 @@ static int tumbler_init(struct snd_pmac *chip)
&mix->line_mute, 1); &mix->line_mute, 1);
irq = tumbler_find_device("headphone-detect", irq = tumbler_find_device("headphone-detect",
NULL, &mix->hp_detect, 0); NULL, &mix->hp_detect, 0);
if (irq <= NO_IRQ) if (irq <= 0)
irq = tumbler_find_device("headphone-detect", irq = tumbler_find_device("headphone-detect",
NULL, &mix->hp_detect, 1); NULL, &mix->hp_detect, 1);
if (irq <= NO_IRQ) if (irq <= 0)
irq = tumbler_find_device("keywest-gpio15", irq = tumbler_find_device("keywest-gpio15",
NULL, &mix->hp_detect, 1); NULL, &mix->hp_detect, 1);
mix->headphone_irq = irq; mix->headphone_irq = irq;
irq = tumbler_find_device("line-output-detect", irq = tumbler_find_device("line-output-detect",
NULL, &mix->line_detect, 0); NULL, &mix->line_detect, 0);
if (irq <= NO_IRQ) if (irq <= 0)
irq = tumbler_find_device("line-output-detect", irq = tumbler_find_device("line-output-detect",
NULL, &mix->line_detect, 1); NULL, &mix->line_detect, 1);
if (IS_G4DA && irq <= NO_IRQ) if (IS_G4DA && irq <= 0)
irq = tumbler_find_device("keywest-gpio16", irq = tumbler_find_device("keywest-gpio16",
NULL, &mix->line_detect, 1); NULL, &mix->line_detect, 1);
mix->lineout_irq = irq; mix->lineout_irq = irq;