Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Remove all usages of NO_IRQ

NO_IRQ has been == 0 on powerpc for just over ten years (since commit
0ebfff1491ef ("[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>

+204 -200
+1 -1
arch/powerpc/include/asm/machdep.h
··· 61 61 62 62 void (*init_IRQ)(void); 63 63 64 - /* Return an irq, or NO_IRQ to indicate there are none pending. */ 64 + /* Return an irq, or 0 to indicate there are none pending. */ 65 65 unsigned int (*get_irq)(void); 66 66 67 67 /* PCI stuff */
+3 -3
arch/powerpc/include/asm/mpic_msgr.h
··· 122 122 * @msgr: the message register whose IRQ is to be returned 123 123 * 124 124 * Returns the IRQ number associated with the given message register. 125 - * NO_IRQ is returned if this message register is not capable of 126 - * receiving interrupts. What message register can and cannot receive 127 - * interrupts is specified in the device tree for the system. 125 + * 0 is returned if this message register is not capable of receiving 126 + * interrupts. What message register can and cannot receive interrupts is 127 + * specified in the device tree for the system. 128 128 */ 129 129 static inline int mpic_msgr_get_irq(struct mpic_msgr *msgr) 130 130 {
+1 -1
arch/powerpc/include/asm/parport.h
··· 28 28 io1 = prop[1]; io2 = prop[2]; 29 29 30 30 virq = irq_of_parse_and_map(np, 0); 31 - if (virq == NO_IRQ) 31 + if (!virq) 32 32 continue; 33 33 34 34 if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0)
+1 -1
arch/powerpc/kernel/ibmebus.c
··· 227 227 { 228 228 unsigned int irq = irq_create_mapping(NULL, ist); 229 229 230 - if (irq == NO_IRQ) 230 + if (!irq) 231 231 return -EINVAL; 232 232 233 233 return request_irq(irq, handler, irq_flags, devname, dev_id);
+1 -1
arch/powerpc/kernel/irq.c
··· 519 519 may_hard_irq_enable(); 520 520 521 521 /* And finally process it */ 522 - if (unlikely(irq == NO_IRQ)) 522 + if (unlikely(!irq)) 523 523 __this_cpu_inc(irq_stat.spurious_irqs); 524 524 else 525 525 generic_handle_irq(irq);
+7 -7
arch/powerpc/kernel/legacy_serial.c
··· 193 193 */ 194 194 if (tsi && !strcmp(tsi->type, "tsi-bridge")) 195 195 return add_legacy_port(np, -1, UPIO_TSI, addr, addr, 196 - NO_IRQ, legacy_port_flags, 0); 196 + 0, legacy_port_flags, 0); 197 197 else 198 198 return add_legacy_port(np, -1, UPIO_MEM, addr, addr, 199 - NO_IRQ, legacy_port_flags, 0); 199 + 0, legacy_port_flags, 0); 200 200 } 201 201 202 202 static int __init add_legacy_isa_port(struct device_node *np, ··· 242 242 243 243 /* Add port, irq will be dealt with later */ 244 244 return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]), 245 - taddr, NO_IRQ, legacy_port_flags, 0); 245 + taddr, 0, legacy_port_flags, 0); 246 246 247 247 } 248 248 ··· 314 314 /* Add port, irq will be dealt with later. We passed a translated 315 315 * IO port value. It will be fixed up later along with the irq 316 316 */ 317 - return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, 317 + return add_legacy_port(np, index, iotype, base, addr, 0, 318 318 legacy_port_flags, np != pci_dev); 319 319 } 320 320 #endif ··· 462 462 DBG("fixup_port_irq(%d)\n", index); 463 463 464 464 virq = irq_of_parse_and_map(np, 0); 465 - if (virq == NO_IRQ && legacy_serial_infos[index].irq_check_parent) { 465 + if (!virq && legacy_serial_infos[index].irq_check_parent) { 466 466 np = of_get_parent(np); 467 467 if (np == NULL) 468 468 return; 469 469 virq = irq_of_parse_and_map(np, 0); 470 470 of_node_put(np); 471 471 } 472 - if (virq == NO_IRQ) 472 + if (!virq) 473 473 return; 474 474 475 475 port->irq = virq; ··· 543 543 struct plat_serial8250_port *port = &legacy_serial_ports[i]; 544 544 struct device_node *np = legacy_serial_infos[i].np; 545 545 546 - if (port->irq == NO_IRQ) 546 + if (!port->irq) 547 547 fixup_port_irq(i, np, port); 548 548 if (port->iotype == UPIO_PORT) 549 549 fixup_port_pio(i, np, port);
+3 -2
arch/powerpc/kernel/pci-common.c
··· 360 360 line, pin); 361 361 362 362 virq = irq_create_mapping(NULL, line); 363 - if (virq != NO_IRQ) 363 + if (virq) 364 364 irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); 365 365 } else { 366 366 pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n", ··· 369 369 370 370 virq = irq_create_of_mapping(&oirq); 371 371 } 372 - if(virq == NO_IRQ) { 372 + 373 + if (!virq) { 373 374 pr_debug(" Failed to map !\n"); 374 375 return -1; 375 376 }
+1 -1
arch/powerpc/kernel/pci_of_scan.c
··· 178 178 dev->hdr_type = PCI_HEADER_TYPE_NORMAL; 179 179 dev->rom_base_reg = PCI_ROM_ADDRESS; 180 180 /* Maybe do a default OF mapping here */ 181 - dev->irq = NO_IRQ; 181 + dev->irq = 0; 182 182 } 183 183 184 184 of_pci_parse_addrs(node, dev);
+1 -1
arch/powerpc/platforms/44x/warp.c
··· 204 204 i2c_smbus_write_byte_data(client, 3, 0); /* Tlow */ 205 205 206 206 irq = irq_of_parse_and_map(np, 0); 207 - if (irq == NO_IRQ) { 207 + if (!irq) { 208 208 printk(KERN_ERR __FILE__ ": Unable to get ad7414 irq\n"); 209 209 return; 210 210 }
+4 -4
arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
··· 97 97 status |= (ignore | mask); 98 98 99 99 if (status == 0xff) 100 - return NO_IRQ; 100 + return 0; 101 101 102 102 cpld_irq = ffz(status) + offset; 103 103 ··· 110 110 111 111 irq = cpld_pic_get_irq(0, PCI_IGNORE, &cpld_regs->pci_status, 112 112 &cpld_regs->pci_mask); 113 - if (irq != NO_IRQ) { 113 + if (irq) { 114 114 generic_handle_irq(irq); 115 115 return; 116 116 } 117 117 118 118 irq = cpld_pic_get_irq(8, MISC_IGNORE, &cpld_regs->misc_status, 119 119 &cpld_regs->misc_mask); 120 - if (irq != NO_IRQ) { 120 + if (irq) { 121 121 generic_handle_irq(irq); 122 122 return; 123 123 } ··· 177 177 goto end; 178 178 179 179 cascade_irq = irq_of_parse_and_map(np, 0); 180 - if (cascade_irq == NO_IRQ) 180 + if (!cascade_irq) 181 181 goto end; 182 182 183 183 /*
+1 -1
arch/powerpc/platforms/512x/mpc512x_lpbfifo.c
··· 473 473 } 474 474 475 475 lpbfifo.irq = irq_of_parse_and_map(pdev->dev.of_node, 0); 476 - if (lpbfifo.irq == NO_IRQ) { 476 + if (!lpbfifo.irq) { 477 477 dev_err(&pdev->dev, "mapping irq failed\n"); 478 478 ret = -ENODEV; 479 479 goto err0;
+1 -1
arch/powerpc/platforms/52xx/mpc52xx_pic.c
··· 511 511 irq |= (MPC52xx_IRQ_L1_PERP << MPC52xx_IRQ_L1_OFFSET); 512 512 } 513 513 } else { 514 - return NO_IRQ; 514 + return 0; 515 515 } 516 516 517 517 return irq_linear_revmap(mpc52xx_irqhost, irq);
+1 -1
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
··· 131 131 } 132 132 133 133 irq = irq_of_parse_and_map(np, 0); 134 - if (irq == NO_IRQ) { 134 + if (!irq) { 135 135 printk(KERN_ERR "No interrupt in pci pic node.\n"); 136 136 of_node_put(np); 137 137 goto out;
+1 -1
arch/powerpc/platforms/83xx/mpc832x_rdb.c
··· 89 89 goto err; 90 90 91 91 ret = of_irq_to_resource(np, 0, &res[1]); 92 - if (ret == NO_IRQ) 92 + if (!ret) 93 93 goto err; 94 94 95 95 pdev = platform_device_alloc("mpc83xx_spi", i);
+2 -2
arch/powerpc/platforms/83xx/suspend.c
··· 352 352 return -ENODEV; 353 353 354 354 pmc_irq = irq_of_parse_and_map(np, 0); 355 - if (pmc_irq != NO_IRQ) { 355 + if (pmc_irq) { 356 356 ret = request_irq(pmc_irq, pmc_irq_handler, IRQF_SHARED, 357 357 "pmc", ofdev); 358 358 ··· 400 400 out_pmc: 401 401 iounmap(pmc_regs); 402 402 out: 403 - if (pmc_irq != NO_IRQ) 403 + if (pmc_irq) 404 404 free_irq(pmc_irq, ofdev); 405 405 406 406 return ret;
+1 -1
arch/powerpc/platforms/85xx/common.c
··· 76 76 return; 77 77 } 78 78 irq = irq_of_parse_and_map(np, 0); 79 - if (irq == NO_IRQ) { 79 + if (!irq) { 80 80 of_node_put(np); 81 81 printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n"); 82 82 return;
+2 -2
arch/powerpc/platforms/85xx/mpc85xx_cds.c
··· 196 196 { 197 197 unsigned int cascade_irq = i8259_irq(); 198 198 199 - if (cascade_irq != NO_IRQ) 199 + if (cascade_irq) 200 200 /* handle an interrupt from the 8259 */ 201 201 generic_handle_irq(cascade_irq); 202 202 ··· 247 247 } 248 248 249 249 cascade_irq = irq_of_parse_and_map(cascade_node, 0); 250 - if (cascade_irq == NO_IRQ) { 250 + if (!cascade_irq) { 251 251 printk(KERN_ERR "Failed to map cascade interrupt\n"); 252 252 return -ENXIO; 253 253 }
+2 -2
arch/powerpc/platforms/85xx/mpc85xx_ds.c
··· 51 51 struct irq_chip *chip = irq_desc_get_chip(desc); 52 52 unsigned int cascade_irq = i8259_irq(); 53 53 54 - if (cascade_irq != NO_IRQ) { 54 + if (cascade_irq) { 55 55 generic_handle_irq(cascade_irq); 56 56 } 57 57 chip->irq_eoi(&desc->irq_data); ··· 96 96 } 97 97 98 98 cascade_irq = irq_of_parse_and_map(cascade_node, 0); 99 - if (cascade_irq == NO_IRQ) { 99 + if (!cascade_irq) { 100 100 printk(KERN_ERR "Failed to map cascade interrupt\n"); 101 101 return; 102 102 }
+3 -3
arch/powerpc/platforms/85xx/socrates_fpga_pic.c
··· 78 78 break; 79 79 } 80 80 if (i == 3) 81 - return NO_IRQ; 81 + return 0; 82 82 83 83 raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); 84 84 cause = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(i)); ··· 103 103 */ 104 104 cascade_irq = socrates_fpga_pic_get_irq(irq); 105 105 106 - if (cascade_irq != NO_IRQ) 106 + if (cascade_irq) 107 107 generic_handle_irq(cascade_irq); 108 108 chip->irq_eoi(&desc->irq_data); 109 109 } ··· 292 292 293 293 for (i = 0; i < 3; i++) { 294 294 socrates_fpga_irqs[i] = irq_of_parse_and_map(pic, i); 295 - if (socrates_fpga_irqs[i] == NO_IRQ) { 295 + if (!socrates_fpga_irqs[i]) { 296 296 pr_warning("FPGA PIC: can't get irq%d.\n", i); 297 297 continue; 298 298 }
+2 -2
arch/powerpc/platforms/86xx/pic.c
··· 22 22 struct irq_chip *chip = irq_desc_get_chip(desc); 23 23 unsigned int cascade_irq = i8259_irq(); 24 24 25 - if (cascade_irq != NO_IRQ) 25 + if (cascade_irq) 26 26 generic_handle_irq(cascade_irq); 27 27 28 28 chip->irq_eoi(&desc->irq_data); ··· 58 58 } 59 59 60 60 cascade_irq = irq_of_parse_and_map(cascade_node, 0); 61 - if (cascade_irq == NO_IRQ) { 61 + if (!cascade_irq) { 62 62 printk(KERN_ERR "Failed to map cascade interrupt\n"); 63 63 return; 64 64 }
+1 -1
arch/powerpc/platforms/8xx/m8xx_setup.c
··· 241 241 } 242 242 243 243 irq = cpm_pic_init(); 244 - if (irq != NO_IRQ) 244 + if (irq) 245 245 irq_set_chained_handler(irq, cpm_cascade); 246 246 }
+3 -3
arch/powerpc/platforms/cell/axon_msi.c
··· 271 271 272 272 for_each_pci_msi_entry(entry, dev) { 273 273 virq = irq_create_direct_mapping(msic->irq_domain); 274 - if (virq == NO_IRQ) { 274 + if (!virq) { 275 275 dev_warn(&dev->dev, 276 276 "axon_msi: virq allocation failed!\n"); 277 277 return -1; ··· 293 293 dev_dbg(&dev->dev, "axon_msi: tearing down msi irqs\n"); 294 294 295 295 for_each_pci_msi_entry(entry, dev) { 296 - if (entry->irq == NO_IRQ) 296 + if (!entry->irq) 297 297 continue; 298 298 299 299 irq_set_msi_desc(entry->irq, NULL); ··· 375 375 } 376 376 377 377 virq = irq_of_parse_and_map(dn, 0); 378 - if (virq == NO_IRQ) { 378 + if (!virq) { 379 379 printk(KERN_ERR "axon_msi: irq parse and map failed for %s\n", 380 380 dn->full_name); 381 381 goto out_free_fifo;
+6 -6
arch/powerpc/platforms/cell/interrupt.c
··· 123 123 unsigned int cirq = 124 124 irq_linear_revmap(iic_host, 125 125 base | cascade); 126 - if (cirq != NO_IRQ) 126 + if (cirq) 127 127 generic_handle_irq(cirq); 128 128 } 129 129 /* post-ack level interrupts */ ··· 153 153 *(unsigned long *) &pending = 154 154 in_be64((u64 __iomem *) &iic->regs->pending_destr); 155 155 if (!(pending.flags & CBE_IIC_IRQ_VALID)) 156 - return NO_IRQ; 156 + return 0; 157 157 virq = irq_linear_revmap(iic_host, iic_pending_to_hwnum(pending)); 158 - if (virq == NO_IRQ) 159 - return NO_IRQ; 158 + if (!virq) 159 + return 0; 160 160 iic->eoi_stack[++iic->eoi_ptr] = pending.prio; 161 161 BUG_ON(iic->eoi_ptr > 15); 162 162 return virq; ··· 192 192 int virq; 193 193 194 194 virq = irq_create_mapping(iic_host, iic_msg_to_irq(msg)); 195 - if (virq == NO_IRQ) { 195 + if (!virq) { 196 196 printk(KERN_ERR 197 197 "iic: failed to map IPI %s\n", smp_ipi_name[msg]); 198 198 return; ··· 347 347 cascade |= 1 << IIC_IRQ_CLASS_SHIFT; 348 348 cascade |= IIC_UNIT_IIC; 349 349 cascade = irq_create_mapping(iic_host, cascade); 350 - if (cascade == NO_IRQ) 350 + if (!cascade) 351 351 continue; 352 352 /* 353 353 * irq_data is a generic pointer that gets passed back
+1 -1
arch/powerpc/platforms/cell/iommu.c
··· 411 411 412 412 virq = irq_create_mapping(NULL, 413 413 IIC_IRQ_IOEX_ATI | (iommu->nid << IIC_IRQ_NODE_SHIFT)); 414 - BUG_ON(virq == NO_IRQ); 414 + BUG_ON(!virq); 415 415 416 416 ret = request_irq(virq, ioc_interrupt, 0, iommu->name, iommu); 417 417 BUG_ON(ret);
+2 -2
arch/powerpc/platforms/cell/pmu.c
··· 385 385 for_each_online_node(node) { 386 386 irq = irq_create_mapping(NULL, IIC_IRQ_IOEX_PMI | 387 387 (node << IIC_IRQ_NODE_SHIFT)); 388 - if (irq == NO_IRQ) { 388 + if (!irq) { 389 389 printk("ERROR: Unable to allocate irq for node %d\n", 390 390 node); 391 391 return -EINVAL; ··· 412 412 IIC_IRQ_IOEX_PMI 413 413 | (node << IIC_IRQ_NODE_SHIFT)); 414 414 415 - if (irq == NO_IRQ) { 415 + if (!irq) { 416 416 printk(KERN_WARNING "ERROR, unable to get existing irq %d " \ 417 417 "for node %d\n", irq, node); 418 418 return;
+9 -9
arch/powerpc/platforms/cell/spider-pic.c
··· 207 207 208 208 cs = in_be32(pic->regs + TIR_CS) >> 24; 209 209 if (cs == SPIDER_IRQ_INVALID) 210 - virq = NO_IRQ; 210 + virq = 0; 211 211 else 212 212 virq = irq_linear_revmap(pic->host, cs); 213 213 214 - if (virq != NO_IRQ) 214 + if (virq) 215 215 generic_handle_irq(virq); 216 216 217 217 chip->irq_eoi(&desc->irq_data); ··· 245 245 /* Now do the horrible hacks */ 246 246 tmp = of_get_property(of_node, "#interrupt-cells", NULL); 247 247 if (tmp == NULL) 248 - return NO_IRQ; 248 + return 0; 249 249 intsize = *tmp; 250 250 imap = of_get_property(of_node, "interrupt-map", &imaplen); 251 251 if (imap == NULL || imaplen < (intsize + 1)) 252 - return NO_IRQ; 252 + return 0; 253 253 iic = of_find_node_by_phandle(imap[intsize]); 254 254 if (iic == NULL) 255 - return NO_IRQ; 255 + return 0; 256 256 imap += intsize + 1; 257 257 tmp = of_get_property(iic, "#interrupt-cells", NULL); 258 258 if (tmp == NULL) { 259 259 of_node_put(iic); 260 - return NO_IRQ; 260 + return 0; 261 261 } 262 262 intsize = *tmp; 263 263 /* Assume unit is last entry of interrupt specifier */ ··· 266 266 tmp = of_get_property(iic, "ibm,interrupt-server-ranges", NULL); 267 267 if (tmp == NULL) { 268 268 of_node_put(iic); 269 - return NO_IRQ; 269 + return 0; 270 270 } 271 271 /* ugly as hell but works for now */ 272 272 pic->node_id = (*tmp) >> 1; ··· 281 281 (pic->node_id << IIC_IRQ_NODE_SHIFT) | 282 282 (2 << IIC_IRQ_CLASS_SHIFT) | 283 283 unit); 284 - if (virq == NO_IRQ) 284 + if (!virq) 285 285 printk(KERN_ERR "spider_pic: failed to map cascade !"); 286 286 return virq; 287 287 } ··· 318 318 319 319 /* Hook up the cascade interrupt to the iic and nodeid */ 320 320 virq = spider_find_cascade_and_node(pic); 321 - if (virq == NO_IRQ) 321 + if (!virq) 322 322 return; 323 323 irq_set_handler_data(virq, pic); 324 324 irq_set_chained_handler(virq, spider_irq_cascade);
+8 -8
arch/powerpc/platforms/cell/spu_base.c
··· 402 402 { 403 403 int ret = 0; 404 404 405 - if (spu->irqs[0] != NO_IRQ) { 405 + if (spu->irqs[0]) { 406 406 snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", 407 407 spu->number); 408 408 ret = request_irq(spu->irqs[0], spu_irq_class_0, ··· 410 410 if (ret) 411 411 goto bail0; 412 412 } 413 - if (spu->irqs[1] != NO_IRQ) { 413 + if (spu->irqs[1]) { 414 414 snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", 415 415 spu->number); 416 416 ret = request_irq(spu->irqs[1], spu_irq_class_1, ··· 418 418 if (ret) 419 419 goto bail1; 420 420 } 421 - if (spu->irqs[2] != NO_IRQ) { 421 + if (spu->irqs[2]) { 422 422 snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", 423 423 spu->number); 424 424 ret = request_irq(spu->irqs[2], spu_irq_class_2, ··· 429 429 return 0; 430 430 431 431 bail2: 432 - if (spu->irqs[1] != NO_IRQ) 432 + if (spu->irqs[1]) 433 433 free_irq(spu->irqs[1], spu); 434 434 bail1: 435 - if (spu->irqs[0] != NO_IRQ) 435 + if (spu->irqs[0]) 436 436 free_irq(spu->irqs[0], spu); 437 437 bail0: 438 438 return ret; ··· 440 440 441 441 static void spu_free_irqs(struct spu *spu) 442 442 { 443 - if (spu->irqs[0] != NO_IRQ) 443 + if (spu->irqs[0]) 444 444 free_irq(spu->irqs[0], spu); 445 - if (spu->irqs[1] != NO_IRQ) 445 + if (spu->irqs[1]) 446 446 free_irq(spu->irqs[1], spu); 447 - if (spu->irqs[2] != NO_IRQ) 447 + if (spu->irqs[2]) 448 448 free_irq(spu->irqs[2], spu); 449 449 } 450 450
+6 -3
arch/powerpc/platforms/cell/spu_manage.c
··· 105 105 spu->irqs[2] = irq_create_mapping(NULL, IIC_IRQ_CLASS_2 | isrc); 106 106 107 107 /* Right now, we only fail if class 2 failed */ 108 - return spu->irqs[2] == NO_IRQ ? -EINVAL : 0; 108 + if (!spu->irqs[2]) 109 + return -EINVAL; 110 + 111 + return 0; 109 112 } 110 113 111 114 static void __iomem * __init spu_map_prop_old(struct spu *spu, ··· 194 191 pr_debug(" irq %d no 0x%x on %s\n", i, oirq.args[0], 195 192 oirq.np->full_name); 196 193 spu->irqs[i] = irq_create_of_mapping(&oirq); 197 - if (spu->irqs[i] == NO_IRQ) { 194 + if (!spu->irqs[i]) { 198 195 pr_debug("spu_new: failed to map it !\n"); 199 196 goto err; 200 197 } ··· 205 202 pr_debug("failed to map irq %x for spu %s\n", *oirq.args, 206 203 spu->name); 207 204 for (; i >= 0; i--) { 208 - if (spu->irqs[i] != NO_IRQ) 205 + if (spu->irqs[i]) 209 206 irq_dispose_mapping(spu->irqs[i]); 210 207 } 211 208 return ret;
+2 -2
arch/powerpc/platforms/chrp/setup.c
··· 368 368 struct irq_chip *chip = irq_desc_get_chip(desc); 369 369 unsigned int cascade_irq = i8259_irq(); 370 370 371 - if (cascade_irq != NO_IRQ) 371 + if (cascade_irq) 372 372 generic_handle_irq(cascade_irq); 373 373 374 374 chip->irq_eoi(&desc->irq_data); ··· 514 514 } 515 515 if (chrp_mpic != NULL) { 516 516 cascade_irq = irq_of_parse_and_map(pic, 0); 517 - if (cascade_irq == NO_IRQ) 517 + if (!cascade_irq) 518 518 printk(KERN_ERR "i8259: failed to map cascade irq\n"); 519 519 else 520 520 irq_set_chained_handler(cascade_irq,
+1 -1
arch/powerpc/platforms/embedded6xx/flipper-pic.c
··· 181 181 irq_status = in_be32(io_base + FLIPPER_ICR) & 182 182 in_be32(io_base + FLIPPER_IMR); 183 183 if (irq_status == 0) 184 - return NO_IRQ; /* no more IRQs pending */ 184 + return 0; /* no more IRQs pending */ 185 185 186 186 irq = __ffs(irq_status); 187 187 return irq_linear_revmap(flipper_irq_host, irq);
+2 -2
arch/powerpc/platforms/embedded6xx/hlwd-pic.c
··· 114 114 irq_status = in_be32(io_base + HW_BROADWAY_ICR) & 115 115 in_be32(io_base + HW_BROADWAY_IMR); 116 116 if (irq_status == 0) 117 - return NO_IRQ; /* no more IRQs pending */ 117 + return 0; /* no more IRQs pending */ 118 118 119 119 irq = __ffs(irq_status); 120 120 return irq_linear_revmap(h, irq); ··· 131 131 raw_spin_unlock(&desc->lock); 132 132 133 133 virq = __hlwd_pic_get_irq(irq_domain); 134 - if (virq != NO_IRQ) 134 + if (virq) 135 135 generic_handle_irq(virq); 136 136 else 137 137 pr_err("spurious interrupt!\n");
+2 -2
arch/powerpc/platforms/embedded6xx/mvme5100.c
··· 47 47 struct irq_chip *chip = irq_desc_get_chip(desc); 48 48 unsigned int cascade_irq = i8259_irq(); 49 49 50 - if (cascade_irq != NO_IRQ) 50 + if (cascade_irq) 51 51 generic_handle_irq(cascade_irq); 52 52 53 53 chip->irq_eoi(&desc->irq_data); ··· 84 84 } 85 85 86 86 cirq = irq_of_parse_and_map(cp, 0); 87 - if (cirq == NO_IRQ) { 87 + if (!cirq) { 88 88 pr_warn("mvme5100_pic_init: no cascade interrupt?\n"); 89 89 return; 90 90 }
+3 -3
arch/powerpc/platforms/maple/pci.c
··· 552 552 pci_bus_to_host(dev->bus) == u4_pcie) { 553 553 printk(KERN_DEBUG "Fixup U4 PCIe IRQ\n"); 554 554 dev->irq = irq_create_mapping(NULL, 1); 555 - if (dev->irq != NO_IRQ) 555 + if (dev->irq) 556 556 irq_set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW); 557 557 } 558 558 ··· 562 562 if (dev->vendor == PCI_VENDOR_ID_AMD && 563 563 dev->device == PCI_DEVICE_ID_AMD_8111_IDE && 564 564 (dev->class & 5) != 5) { 565 - dev->irq = NO_IRQ; 565 + dev->irq = 0; 566 566 } 567 567 568 568 DBG(" <- maple_pci_irq_fixup\n"); ··· 648 648 return defirq; 649 649 } 650 650 irq = irq_of_parse_and_map(np, channel & 0x1); 651 - if (irq == NO_IRQ) { 651 + if (!irq) { 652 652 printk("Failed to map onboard IDE interrupt for channel %d\n", 653 653 channel); 654 654 return defirq;
+1 -1
arch/powerpc/platforms/pasemi/misc.c
··· 76 76 } 77 77 78 78 info.irq = irq_of_parse_and_map(node, 0); 79 - if (info.irq == NO_IRQ) 79 + if (!info.irq) 80 80 info.irq = -1; 81 81 82 82 if (find_i2c_driver(node, &info) < 0)
+2 -2
arch/powerpc/platforms/pasemi/msi.c
··· 68 68 pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev); 69 69 70 70 for_each_pci_msi_entry(entry, pdev) { 71 - if (entry->irq == NO_IRQ) 71 + if (!entry->irq) 72 72 continue; 73 73 74 74 hwirq = virq_to_hw(entry->irq); ··· 109 109 } 110 110 111 111 virq = irq_create_mapping(msi_mpic->irqhost, hwirq); 112 - if (virq == NO_IRQ) { 112 + if (!virq) { 113 113 pr_debug("pasemi_msi: failed mapping hwirq 0x%x\n", 114 114 hwirq); 115 115 msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq,
+2 -2
arch/powerpc/platforms/pasemi/setup.c
··· 59 59 60 60 static struct mce_regs mce_regs[MAX_MCE_REGS]; 61 61 static int num_mce_regs; 62 - static int nmi_virq = NO_IRQ; 62 + static int nmi_virq = 0; 63 63 64 64 65 65 static void __noreturn pas_restart(char *cmd) ··· 264 264 srr0 = regs->nip; 265 265 srr1 = regs->msr; 266 266 267 - if (nmi_virq != NO_IRQ && mpic_get_mcirq() == nmi_virq) { 267 + if (nmi_virq && mpic_get_mcirq() == nmi_virq) { 268 268 printk(KERN_ERR "NMI delivered\n"); 269 269 debugger(regs); 270 270 mpic_end_irq(irq_get_irq_data(nmi_virq));
+3 -3
arch/powerpc/platforms/powermac/low_i2c.c
··· 401 401 { 402 402 struct pmac_i2c_host_kw *host = bus->hostdata; 403 403 u8 mode_reg = host->speed; 404 - int use_irq = host->irq != NO_IRQ && !bus->polled; 404 + int use_irq = host->irq && !bus->polled; 405 405 406 406 /* Setup mode & subaddress if any */ 407 407 switch(bus->mode) { ··· 535 535 break; 536 536 } 537 537 host->irq = irq_of_parse_and_map(np, 0); 538 - if (host->irq == NO_IRQ) 538 + if (!host->irq) 539 539 printk(KERN_WARNING 540 540 "low_i2c: Failed to map interrupt for %s\n", 541 541 np->full_name); ··· 557 557 */ 558 558 if (request_irq(host->irq, kw_i2c_irq, IRQF_NO_SUSPEND, 559 559 "keywest i2c", host)) 560 - host->irq = NO_IRQ; 560 + host->irq = 0; 561 561 562 562 printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n", 563 563 *addrp, host->irq, np->full_name);
+2 -2
arch/powerpc/platforms/powermac/pfunc_base.c
··· 26 26 static int macio_do_gpio_irq_enable(struct pmf_function *func) 27 27 { 28 28 unsigned int irq = irq_of_parse_and_map(func->node, 0); 29 - if (irq == NO_IRQ) 29 + if (!irq) 30 30 return -EINVAL; 31 31 return request_irq(irq, macio_gpio_irq, 0, func->node->name, func); 32 32 } ··· 34 34 static int macio_do_gpio_irq_disable(struct pmf_function *func) 35 35 { 36 36 unsigned int irq = irq_of_parse_and_map(func->node, 0); 37 - if (irq == NO_IRQ) 37 + if (!irq) 38 38 return -EINVAL; 39 39 free_irq(irq, func); 40 40 return 0;
+3 -3
arch/powerpc/platforms/powermac/pic.c
··· 251 251 } 252 252 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags); 253 253 if (unlikely(irq < 0)) 254 - return NO_IRQ; 254 + return 0; 255 255 return irq_linear_revmap(pmac_pic_host, irq); 256 256 } 257 257 ··· 389 389 out_le32(&pmac_irq_hw[i]->enable, 0); 390 390 391 391 /* Hookup cascade irq */ 392 - if (slave && pmac_irq_cascade != NO_IRQ) 392 + if (slave && pmac_irq_cascade) 393 393 setup_irq(pmac_irq_cascade, &gatwick_cascade_action); 394 394 395 395 printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs); ··· 444 444 pswitch = of_find_node_by_name(NULL, "programmer-switch"); 445 445 if (pswitch) { 446 446 nmi_irq = irq_of_parse_and_map(pswitch, 0); 447 - if (nmi_irq != NO_IRQ) { 447 + if (nmi_irq) { 448 448 mpic_irq_set_priority(nmi_irq, 9); 449 449 setup_irq(nmi_irq, &xmon_action); 450 450 }
+2 -2
arch/powerpc/platforms/powernv/opal-irqchip.c
··· 222 222 /* Get hardware and virtual IRQ */ 223 223 irq = be32_to_cpup(irqs); 224 224 virq = irq_create_mapping(NULL, irq); 225 - if (virq == NO_IRQ) { 225 + if (!virq) { 226 226 pr_warn("Failed to map irq 0x%x\n", irq); 227 227 continue; 228 228 } ··· 260 260 int opal_event_request(unsigned int opal_event_nr) 261 261 { 262 262 if (WARN_ON_ONCE(!opal_event_irqchip.domain)) 263 - return NO_IRQ; 263 + return 0; 264 264 265 265 return irq_create_mapping(opal_event_irqchip.domain, opal_event_nr); 266 266 }
+2 -2
arch/powerpc/platforms/powernv/pci-cxl.c
··· 344 344 return (hwirq ? hwirq : -ENOMEM); 345 345 346 346 virq = irq_create_mapping(NULL, hwirq); 347 - if (virq == NO_IRQ) { 347 + if (!virq) { 348 348 pr_warn("%s: Failed to map cxl mode MSI to linux irq\n", 349 349 pci_name(pdev)); 350 350 return -ENOMEM; ··· 374 374 return; 375 375 376 376 for_each_pci_msi_entry(entry, pdev) { 377 - if (entry->irq == NO_IRQ) 377 + if (!entry->irq) 378 378 continue; 379 379 hwirq = virq_to_hw(entry->irq); 380 380 irq_set_msi_desc(entry->irq, NULL);
+2 -2
arch/powerpc/platforms/powernv/pci.c
··· 186 186 return -ENOSPC; 187 187 } 188 188 virq = irq_create_mapping(NULL, phb->msi_base + hwirq); 189 - if (virq == NO_IRQ) { 189 + if (!virq) { 190 190 pr_warn("%s: Failed to map MSI to linux irq\n", 191 191 pci_name(pdev)); 192 192 msi_bitmap_free_hwirqs(&phb->msi_bmp, hwirq, 1); ··· 217 217 return; 218 218 219 219 for_each_pci_msi_entry(entry, pdev) { 220 - if (entry->irq == NO_IRQ) 220 + if (!entry->irq) 221 221 continue; 222 222 hwirq = virq_to_hw(entry->irq); 223 223 irq_set_msi_desc(entry->irq, NULL);
+5 -5
arch/powerpc/platforms/ps3/interrupt.c
··· 192 192 193 193 *virq = irq_create_mapping(NULL, outlet); 194 194 195 - if (*virq == NO_IRQ) { 195 + if (!*virq) { 196 196 FAIL("%s:%d: irq_create_mapping failed: outlet %lu\n", 197 197 __func__, __LINE__, outlet); 198 198 result = -ENOMEM; ··· 339 339 if (result) { 340 340 FAIL("%s:%d: lv1_construct_event_receive_port failed: %s\n", 341 341 __func__, __LINE__, ps3_result(result)); 342 - *virq = NO_IRQ; 342 + *virq = 0; 343 343 return result; 344 344 } 345 345 ··· 418 418 " failed: %s\n", __func__, __LINE__, 419 419 ps3_result(result)); 420 420 ps3_event_receive_port_destroy(*virq); 421 - *virq = NO_IRQ; 421 + *virq = 0; 422 422 return result; 423 423 } 424 424 ··· 724 724 asm volatile("cntlzd %0,%1" : "=r" (plug) : "r" (x)); 725 725 plug &= 0x3f; 726 726 727 - if (unlikely(plug == NO_IRQ)) { 727 + if (unlikely(!plug)) { 728 728 DBG("%s:%d: no plug found: thread_id %llu\n", __func__, 729 729 __LINE__, pd->thread_id); 730 730 dump_bmp(&per_cpu(ps3_private, 0)); 731 731 dump_bmp(&per_cpu(ps3_private, 1)); 732 - return NO_IRQ; 732 + return 0; 733 733 } 734 734 735 735 #if defined(DEBUG)
+2 -2
arch/powerpc/platforms/ps3/smp.c
··· 91 91 result = smp_request_message_ipi(virqs[i], i); 92 92 93 93 if (result) 94 - virqs[i] = NO_IRQ; 94 + virqs[i] = 0; 95 95 else 96 96 ps3_register_ipi_irq(cpu, virqs[i]); 97 97 } ··· 112 112 for (i = 0; i < MSG_COUNT; i++) { 113 113 /* Can't call free_irq from interrupt context. */ 114 114 ps3_event_receive_port_destroy(virqs[i]); 115 - virqs[i] = NO_IRQ; 115 + virqs[i] = 0; 116 116 } 117 117 118 118 DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu);
+2 -2
arch/powerpc/platforms/ps3/spu.c
··· 284 284 fail_alloc_1: 285 285 ps3_spe_irq_destroy(spu->irqs[0]); 286 286 fail_alloc_0: 287 - spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = NO_IRQ; 287 + spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = 0; 288 288 return result; 289 289 } 290 290 ··· 334 334 ps3_spe_irq_destroy(spu->irqs[1]); 335 335 ps3_spe_irq_destroy(spu->irqs[0]); 336 336 337 - spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = NO_IRQ; 337 + spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = 0; 338 338 339 339 spu_unmap(spu); 340 340
+1 -1
arch/powerpc/platforms/pseries/event_sources.c
··· 34 34 if (count > 15) 35 35 break; 36 36 virqs[count] = irq_create_of_mapping(&oirq); 37 - if (virqs[count] == NO_IRQ) { 37 + if (!virqs[count]) { 38 38 pr_err("event-sources: Unable to allocate " 39 39 "interrupt number for %s\n", 40 40 np->full_name);
+3 -3
arch/powerpc/platforms/pseries/msi.c
··· 119 119 struct msi_desc *entry; 120 120 121 121 for_each_pci_msi_entry(entry, pdev) { 122 - if (entry->irq == NO_IRQ) 122 + if (!entry->irq) 123 123 continue; 124 124 125 125 irq_set_msi_desc(entry->irq, NULL); ··· 471 471 472 472 virq = irq_create_mapping(NULL, hwirq); 473 473 474 - if (virq == NO_IRQ) { 474 + if (!virq) { 475 475 pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq); 476 476 return -ENOSPC; 477 477 } ··· 490 490 static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev) 491 491 { 492 492 /* No LSI -> leave MSIs (if any) configured */ 493 - if (pdev->irq == NO_IRQ) { 493 + if (!pdev->irq) { 494 494 dev_dbg(&pdev->dev, "rtas_msi: no LSI, nothing to do.\n"); 495 495 return; 496 496 }
+2 -2
arch/powerpc/platforms/pseries/setup.c
··· 114 114 struct irq_chip *chip = irq_desc_get_chip(desc); 115 115 unsigned int cascade_irq = i8259_irq(); 116 116 117 - if (cascade_irq != NO_IRQ) 117 + if (cascade_irq) 118 118 generic_handle_irq(cascade_irq); 119 119 120 120 chip->irq_eoi(&desc->irq_data); ··· 141 141 } 142 142 143 143 cascade = irq_of_parse_and_map(found, 0); 144 - if (cascade == NO_IRQ) { 144 + if (!cascade) { 145 145 printk(KERN_ERR "pic: failed to map cascade interrupt"); 146 146 return; 147 147 }
+3 -3
arch/powerpc/sysdev/axonram.c
··· 240 240 device_add_disk(&device->dev, bank->disk); 241 241 242 242 bank->irq_id = irq_of_parse_and_map(device->dev.of_node, 0); 243 - if (bank->irq_id == NO_IRQ) { 243 + if (!bank->irq_id) { 244 244 dev_err(&device->dev, "Cannot access ECC interrupt ID\n"); 245 245 rc = -EFAULT; 246 246 goto failed; ··· 250 250 AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device); 251 251 if (rc != 0) { 252 252 dev_err(&device->dev, "Cannot register ECC interrupt handler\n"); 253 - bank->irq_id = NO_IRQ; 253 + bank->irq_id = 0; 254 254 rc = -EFAULT; 255 255 goto failed; 256 256 } ··· 268 268 269 269 failed: 270 270 if (bank != NULL) { 271 - if (bank->irq_id != NO_IRQ) 271 + if (bank->irq_id) 272 272 free_irq(bank->irq_id, device); 273 273 if (bank->disk != NULL) { 274 274 if (bank->disk->major > 0)
+4 -4
arch/powerpc/sysdev/cpm1.c
··· 132 132 { 133 133 struct device_node *np = NULL; 134 134 struct resource res; 135 - unsigned int sirq = NO_IRQ, hwirq, eirq; 135 + unsigned int sirq = 0, hwirq, eirq; 136 136 int ret; 137 137 138 138 pr_debug("cpm_pic_init\n"); ··· 154 154 goto end; 155 155 156 156 sirq = irq_of_parse_and_map(np, 0); 157 - if (sirq == NO_IRQ) 157 + if (!sirq) 158 158 goto end; 159 159 160 160 /* Initialize the CPM interrupt controller. */ ··· 168 168 cpm_pic_host = irq_domain_add_linear(np, 64, &cpm_pic_host_ops, NULL); 169 169 if (cpm_pic_host == NULL) { 170 170 printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); 171 - sirq = NO_IRQ; 171 + sirq = 0; 172 172 goto end; 173 173 } 174 174 ··· 182 182 } 183 183 184 184 eirq = irq_of_parse_and_map(np, 0); 185 - if (eirq == NO_IRQ) 185 + if (!eirq) 186 186 goto end; 187 187 188 188 if (setup_irq(eirq, &cpm_error_irqaction))
+2 -2
arch/powerpc/sysdev/ehv_pic.c
··· 155 155 .irq_set_type = ehv_pic_set_irq_type, 156 156 }; 157 157 158 - /* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ 158 + /* Return an interrupt vector or 0 if no interrupt is pending. */ 159 159 unsigned int ehv_pic_get_irq(void) 160 160 { 161 161 int irq; ··· 168 168 ev_int_iack(0, &irq); /* legacy mode */ 169 169 170 170 if (irq == 0xFFFF) /* 0xFFFF --> no irq is pending */ 171 - return NO_IRQ; 171 + return 0; 172 172 173 173 /* 174 174 * this will also setup revmap[] in the slow path for the first
+1 -1
arch/powerpc/sysdev/fsl_gtm.c
··· 406 406 unsigned int irq; 407 407 408 408 irq = irq_of_parse_and_map(np, i); 409 - if (irq == NO_IRQ) { 409 + if (!irq) { 410 410 pr_err("%s: not enough interrupts specified\n", 411 411 np->full_name); 412 412 goto err;
+3 -3
arch/powerpc/sysdev/fsl_mpic_err.c
··· 115 115 errint = __builtin_clz(eisr); 116 116 cascade_irq = irq_linear_revmap(mpic->irqhost, 117 117 mpic->err_int_vecs[errint]); 118 - WARN_ON(cascade_irq == NO_IRQ); 119 - if (cascade_irq != NO_IRQ) { 118 + WARN_ON(!cascade_irq); 119 + if (cascade_irq) { 120 120 generic_handle_irq(cascade_irq); 121 121 } else { 122 122 eimr |= 1 << (31 - errint); ··· 134 134 int ret; 135 135 136 136 virq = irq_create_mapping(mpic->irqhost, irqnum); 137 - if (virq == NO_IRQ) { 137 + if (!virq) { 138 138 pr_err("Error interrupt setup failed\n"); 139 139 return; 140 140 }
+6 -6
arch/powerpc/sysdev/fsl_msi.c
··· 131 131 irq_hw_number_t hwirq; 132 132 133 133 for_each_pci_msi_entry(entry, pdev) { 134 - if (entry->irq == NO_IRQ) 134 + if (!entry->irq) 135 135 continue; 136 136 hwirq = virq_to_hw(entry->irq); 137 137 msi_data = irq_get_chip_data(entry->irq); ··· 250 250 251 251 virq = irq_create_mapping(msi_data->irqhost, hwirq); 252 252 253 - if (virq == NO_IRQ) { 253 + if (!virq) { 254 254 dev_err(&pdev->dev, "fail mapping hwirq %i\n", hwirq); 255 255 msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1); 256 256 rc = -ENOSPC; ··· 285 285 msir_index = cascade_data->index; 286 286 287 287 if (msir_index >= NR_MSI_REG_MAX) 288 - cascade_irq = NO_IRQ; 288 + cascade_irq = 0; 289 289 290 290 switch (msi_data->feature & FSL_PIC_IP_MASK) { 291 291 case FSL_PIC_IP_MPIC: ··· 315 315 cascade_irq = irq_linear_revmap(msi_data->irqhost, 316 316 msi_hwirq(msi_data, msir_index, 317 317 intr_index + have_shift)); 318 - if (cascade_irq != NO_IRQ) { 318 + if (cascade_irq) { 319 319 generic_handle_irq(cascade_irq); 320 320 ret = IRQ_HANDLED; 321 321 } ··· 337 337 if (msi->cascade_array[i]) { 338 338 virq = msi->cascade_array[i]->virq; 339 339 340 - BUG_ON(virq == NO_IRQ); 340 + BUG_ON(!virq); 341 341 342 342 free_irq(virq, msi->cascade_array[i]); 343 343 kfree(msi->cascade_array[i]); ··· 362 362 int virt_msir, i, ret; 363 363 364 364 virt_msir = irq_of_parse_and_map(dev->dev.of_node, irq_index); 365 - if (virt_msir == NO_IRQ) { 365 + if (!virt_msir) { 366 366 dev_err(&dev->dev, "%s: Cannot translate IRQ index %d\n", 367 367 __func__, irq_index); 368 368 return 0;
+4 -4
arch/powerpc/sysdev/ge/ge_pic.c
··· 102 102 */ 103 103 cascade_irq = gef_pic_get_irq(); 104 104 105 - if (cascade_irq != NO_IRQ) 105 + if (cascade_irq) 106 106 generic_handle_irq(cascade_irq); 107 107 108 108 chip->irq_eoi(&desc->irq_data); ··· 206 206 207 207 /* Map controller */ 208 208 gef_pic_cascade_irq = irq_of_parse_and_map(np, 0); 209 - if (gef_pic_cascade_irq == NO_IRQ) { 209 + if (!gef_pic_cascade_irq) { 210 210 printk(KERN_ERR "SBC610: failed to map cascade interrupt"); 211 211 return; 212 212 } ··· 223 223 224 224 /* 225 225 * This is called when we receive an interrupt with apparently comes from this 226 - * chip - check, returning the highest interrupt generated or return NO_IRQ 226 + * chip - check, returning the highest interrupt generated or return 0. 227 227 */ 228 228 unsigned int gef_pic_get_irq(void) 229 229 { 230 230 u32 cause, mask, active; 231 - unsigned int virq = NO_IRQ; 231 + unsigned int virq = 0; 232 232 int hwirq; 233 233 234 234 cause = in_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_STATUS);
+2 -2
arch/powerpc/sysdev/i8259.c
··· 68 68 if (!pci_intack) 69 69 outb(0x0B, 0x20); /* ISR register */ 70 70 if(~inb(0x20) & 0x80) 71 - irq = NO_IRQ; 71 + irq = 0; 72 72 } else if (irq == 0xff) 73 - irq = NO_IRQ; 73 + irq = 0; 74 74 75 75 if (lock) 76 76 raw_spin_unlock(&i8259_lock);
+2 -2
arch/powerpc/sysdev/ipic.c
··· 853 853 ipic_write(primary_ipic->regs, IPIC_SERMR, mask); 854 854 } 855 855 856 - /* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ 856 + /* Return an interrupt vector or 0 if no interrupt is pending. */ 857 857 unsigned int ipic_get_irq(void) 858 858 { 859 859 int irq; ··· 864 864 irq = ipic_read(primary_ipic->regs, IPIC_SIVCR) & IPIC_SIVCR_VECTOR_MASK; 865 865 866 866 if (irq == 0) /* 0 --> no irq is pending */ 867 - return NO_IRQ; 867 + return 0; 868 868 869 869 return irq_linear_revmap(primary_ipic->irqhost, irq); 870 870 }
+1 -1
arch/powerpc/sysdev/mpc8xx_pic.c
··· 79 79 irq = in_be32(&siu_reg->sc_sivec) >> 26; 80 80 81 81 if (irq == PIC_VEC_SPURRIOUS) 82 - irq = NO_IRQ; 82 + irq = 0; 83 83 84 84 return irq_linear_revmap(mpc8xx_pic_host, irq); 85 85
+7 -7
arch/powerpc/sysdev/mpic.c
··· 1649 1649 /* Check if this MPIC is chained from a parent interrupt controller */ 1650 1650 if (mpic->flags & MPIC_SECONDARY) { 1651 1651 int virq = irq_of_parse_and_map(mpic->node, 0); 1652 - if (virq != NO_IRQ) { 1652 + if (virq) { 1653 1653 printk(KERN_INFO "%s: hooking up to IRQ %d\n", 1654 1654 mpic->node->full_name, virq); 1655 1655 irq_set_handler_data(virq, mpic); ··· 1778 1778 if (unlikely(src == mpic->spurious_vec)) { 1779 1779 if (mpic->flags & MPIC_SPV_EOI) 1780 1780 mpic_eoi(mpic); 1781 - return NO_IRQ; 1781 + return 0; 1782 1782 } 1783 1783 if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { 1784 1784 printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n", 1785 1785 mpic->name, (int)src); 1786 1786 mpic_eoi(mpic); 1787 - return NO_IRQ; 1787 + return 0; 1788 1788 } 1789 1789 1790 1790 return irq_linear_revmap(mpic->irqhost, src); ··· 1817 1817 if (unlikely(src == mpic->spurious_vec)) { 1818 1818 if (mpic->flags & MPIC_SPV_EOI) 1819 1819 mpic_eoi(mpic); 1820 - return NO_IRQ; 1820 + return 0; 1821 1821 } 1822 1822 if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { 1823 1823 printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n", 1824 1824 mpic->name, (int)src); 1825 - return NO_IRQ; 1825 + return 0; 1826 1826 } 1827 1827 1828 1828 return irq_linear_revmap(mpic->irqhost, src); 1829 1829 #else 1830 - return NO_IRQ; 1830 + return 0; 1831 1831 #endif 1832 1832 } 1833 1833 ··· 1852 1852 for (i = 0; i < 4; i++) { 1853 1853 unsigned int vipi = irq_create_mapping(mpic->irqhost, 1854 1854 mpic->ipi_vecs[0] + i); 1855 - if (vipi == NO_IRQ) { 1855 + if (!vipi) { 1856 1856 printk(KERN_ERR "Failed to map %s\n", smp_ipi_name[i]); 1857 1857 continue; 1858 1858 }
+2 -2
arch/powerpc/sysdev/mpic_msgr.c
··· 238 238 239 239 if (receive_mask & (1 << i)) { 240 240 msgr->irq = irq_of_parse_and_map(np, irq_index); 241 - if (msgr->irq == NO_IRQ) { 241 + if (!msgr->irq) { 242 242 dev_err(&dev->dev, 243 243 "Missing interrupt specifier"); 244 244 kfree(msgr); ··· 246 246 } 247 247 irq_index += 1; 248 248 } else { 249 - msgr->irq = NO_IRQ; 249 + msgr->irq = 0; 250 250 } 251 251 252 252 mpic_msgrs[reg_number] = msgr;
+2 -2
arch/powerpc/sysdev/mpic_u3msi.c
··· 110 110 irq_hw_number_t hwirq; 111 111 112 112 for_each_pci_msi_entry(entry, pdev) { 113 - if (entry->irq == NO_IRQ) 113 + if (!entry->irq) 114 114 continue; 115 115 116 116 hwirq = virq_to_hw(entry->irq); ··· 155 155 msg.address_hi = addr >> 32; 156 156 157 157 virq = irq_create_mapping(msi_mpic->irqhost, hwirq); 158 - if (virq == NO_IRQ) { 158 + if (!virq) { 159 159 pr_debug("u3msi: failed mapping hwirq 0x%x\n", hwirq); 160 160 msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1); 161 161 return -ENOSPC;
+1 -1
arch/powerpc/sysdev/mv64x60_pic.c
··· 272 272 u32 cause; 273 273 int level1; 274 274 irq_hw_number_t hwirq; 275 - int virq = NO_IRQ; 275 + int virq = 0; 276 276 277 277 cause = in_le32(mv64x60_irq_reg_base + MV64X60_IC_CPU0_SELECT_CAUSE); 278 278 if (cause & MV64X60_SELECT_CAUSE_HIGH) {
+1 -1
arch/powerpc/sysdev/pmi.c
··· 158 158 data->dev = dev; 159 159 160 160 data->irq = irq_of_parse_and_map(np, 0); 161 - if (data->irq == NO_IRQ) { 161 + if (!data->irq) { 162 162 printk(KERN_ERR "pmi: invalid interrupt.\n"); 163 163 rc = -EFAULT; 164 164 goto error_cleanup_iomap;
+3 -3
arch/powerpc/sysdev/ppc4xx_hsta_msi.c
··· 60 60 } 61 61 62 62 hwirq = ppc4xx_hsta_msi.irq_map[irq]; 63 - if (hwirq == NO_IRQ) { 63 + if (!hwirq) { 64 64 pr_err("%s: Failed mapping irq %d\n", __func__, irq); 65 65 return -EINVAL; 66 66 } ··· 110 110 int irq; 111 111 112 112 for_each_pci_msi_entry(entry, dev) { 113 - if (entry->irq == NO_IRQ) 113 + if (!entry->irq) 114 114 continue; 115 115 116 116 irq = hsta_find_hwirq_offset(entry->irq); ··· 166 166 for (irq = 0; irq < irq_count; irq++) { 167 167 ppc4xx_hsta_msi.irq_map[irq] = 168 168 irq_of_parse_and_map(dev->of_node, irq); 169 - if (ppc4xx_hsta_msi.irq_map[irq] == NO_IRQ) { 169 + if (!ppc4xx_hsta_msi.irq_map[irq]) { 170 170 dev_err(dev, "Unable to map IRQ\n"); 171 171 ret = -EINVAL; 172 172 goto out2;
+3 -3
arch/powerpc/sysdev/ppc4xx_msi.c
··· 102 102 __func__); 103 103 } 104 104 virq = irq_of_parse_and_map(msi_data->msi_dev, int_no); 105 - if (virq == NO_IRQ) { 105 + if (!virq) { 106 106 dev_err(&dev->dev, "%s: fail mapping irq\n", __func__); 107 107 msi_bitmap_free_hwirqs(&msi_data->bitmap, int_no, 1); 108 108 return -ENOSPC; ··· 129 129 dev_dbg(&dev->dev, "PCIE-MSI: tearing down msi irqs\n"); 130 130 131 131 for_each_pci_msi_entry(entry, dev) { 132 - if (entry->irq == NO_IRQ) 132 + if (!entry->irq) 133 133 continue; 134 134 hwirq = virq_to_hw(entry->irq); 135 135 irq_set_msi_desc(entry->irq, NULL); ··· 201 201 202 202 for (i = 0; i < msi_irqs; i++) { 203 203 virq = msi->msi_virqs[i]; 204 - if (virq != NO_IRQ) 204 + if (virq) 205 205 irq_dispose_mapping(virq); 206 206 } 207 207
+1 -1
arch/powerpc/sysdev/ppc4xx_soc.c
··· 109 109 110 110 /* Get and map irq number from device tree */ 111 111 irq = irq_of_parse_and_map(np, 0); 112 - if (irq == NO_IRQ) { 112 + if (!irq) { 113 113 printk(KERN_ERR "irq_of_parse_and_map failed\n"); 114 114 of_node_put(np); 115 115 return -ENODEV;
+1 -1
arch/powerpc/sysdev/tsi108_pci.c
··· 433 433 struct irq_chip *chip = irq_desc_get_chip(desc); 434 434 unsigned int cascade_irq = get_pci_source(); 435 435 436 - if (cascade_irq != NO_IRQ) 436 + if (cascade_irq) 437 437 generic_handle_irq(cascade_irq); 438 438 439 439 chip->irq_eoi(&desc->irq_data);
+1 -1
arch/powerpc/sysdev/uic.c
··· 319 319 } 320 320 } 321 321 322 - /* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ 322 + /* Return an interrupt vector or 0 if no interrupt is pending. */ 323 323 unsigned int uic_get_irq(void) 324 324 { 325 325 u32 msr;
+3 -3
arch/powerpc/sysdev/xics/icp-hv.c
··· 112 112 unsigned int irq; 113 113 114 114 if (vec == XICS_IRQ_SPURIOUS) 115 - return NO_IRQ; 115 + return 0; 116 116 117 117 irq = irq_find_mapping(xics_host, vec); 118 - if (likely(irq != NO_IRQ)) { 118 + if (likely(irq)) { 119 119 xics_push_cppr(vec); 120 120 return irq; 121 121 } ··· 126 126 /* We might learn about it later, so EOI it */ 127 127 icp_hv_set_xirr(xirr); 128 128 129 - return NO_IRQ; 129 + return 0; 130 130 } 131 131 132 132 static void icp_hv_set_cpu_priority(unsigned char cppr)
+3 -3
arch/powerpc/sysdev/xics/icp-native.c
··· 124 124 unsigned int irq; 125 125 126 126 if (vec == XICS_IRQ_SPURIOUS) 127 - return NO_IRQ; 127 + return 0; 128 128 129 129 irq = irq_find_mapping(xics_host, vec); 130 - if (likely(irq != NO_IRQ)) { 130 + if (likely(irq)) { 131 131 xics_push_cppr(vec); 132 132 return irq; 133 133 } ··· 138 138 /* We might learn about it later, so EOI it */ 139 139 icp_native_set_xirr(xirr); 140 140 141 - return NO_IRQ; 141 + return 0; 142 142 } 143 143 144 144 #ifdef CONFIG_SMP
+4 -4
arch/powerpc/sysdev/xics/icp-opal.c
··· 51 51 52 52 rc = opal_int_get_xirr(&xirr, false); 53 53 if (rc < 0) 54 - return NO_IRQ; 54 + return 0; 55 55 xirr = be32_to_cpu(xirr); 56 56 vec = xirr & 0x00ffffff; 57 57 if (vec == XICS_IRQ_SPURIOUS) 58 - return NO_IRQ; 58 + return 0; 59 59 60 60 irq = irq_find_mapping(xics_host, vec); 61 - if (likely(irq != NO_IRQ)) { 61 + if (likely(irq)) { 62 62 xics_push_cppr(vec); 63 63 return irq; 64 64 } ··· 69 69 /* We might learn about it later, so EOI it */ 70 70 opal_int_eoi(xirr); 71 71 72 - return NO_IRQ; 72 + return 0; 73 73 } 74 74 75 75 static void icp_opal_set_cpu_priority(unsigned char cppr)
+1 -1
arch/powerpc/sysdev/xics/xics-common.c
··· 131 131 unsigned int ipi; 132 132 133 133 ipi = irq_create_mapping(xics_host, XICS_IPI); 134 - BUG_ON(ipi == NO_IRQ); 134 + BUG_ON(!ipi); 135 135 136 136 /* 137 137 * IPIs are marked IRQF_PERCPU. The handler was set in map.
+2 -2
drivers/macintosh/macio_asic.c
··· 236 236 unsigned int irq; 237 237 238 238 irq = irq_create_mapping(NULL, line); 239 - if (irq != NO_IRQ) { 239 + if (!irq) { 240 240 dev->interrupt[index].start = irq; 241 241 dev->interrupt[index].flags = IORESOURCE_IRQ; 242 242 dev->interrupt[index].name = dev_name(&dev->ofdev.dev); ··· 299 299 break; 300 300 res = &dev->interrupt[j]; 301 301 irq = irq_of_parse_and_map(np, i++); 302 - if (irq == NO_IRQ) 302 + if (!irq) 303 303 break; 304 304 res->start = irq; 305 305 res->flags = IORESOURCE_IRQ;
+1 -1
drivers/macintosh/rack-meter.c
··· 427 427 rm->irq = macio_irq(mdev, 1); 428 428 #else 429 429 rm->irq = irq_of_parse_and_map(i2s, 1); 430 - if (rm->irq == NO_IRQ || 430 + if (!rm->irq || 431 431 of_address_to_resource(i2s, 0, &ri2s) || 432 432 of_address_to_resource(i2s, 1, &rdma)) { 433 433 printk(KERN_ERR
+9 -9
drivers/macintosh/smu.c
··· 279 279 spin_unlock_irqrestore(&smu->lock, flags); 280 280 281 281 /* Workaround for early calls when irq isn't available */ 282 - if (!smu_irq_inited || smu->db_irq == NO_IRQ) 282 + if (!smu_irq_inited || !smu->db_irq) 283 283 smu_spinwait_cmd(cmd); 284 284 285 285 return 0; ··· 498 498 INIT_LIST_HEAD(&smu->cmd_list); 499 499 INIT_LIST_HEAD(&smu->cmd_i2c_list); 500 500 smu->of_node = np; 501 - smu->db_irq = NO_IRQ; 502 - smu->msg_irq = NO_IRQ; 501 + smu->db_irq = 0; 502 + smu->msg_irq = 0; 503 503 504 504 /* smu_cmdbuf_abs is in the low 2G of RAM, can be converted to a 505 505 * 32 bits value safely ··· 587 587 588 588 if (smu->db_node) { 589 589 smu->db_irq = irq_of_parse_and_map(smu->db_node, 0); 590 - if (smu->db_irq == NO_IRQ) 590 + if (!smu->db_irq) 591 591 printk(KERN_ERR "smu: failed to map irq for node %s\n", 592 592 smu->db_node->full_name); 593 593 } 594 594 if (smu->msg_node) { 595 595 smu->msg_irq = irq_of_parse_and_map(smu->msg_node, 0); 596 - if (smu->msg_irq == NO_IRQ) 596 + if (!smu->msg_irq) 597 597 printk(KERN_ERR "smu: failed to map irq for node %s\n", 598 598 smu->msg_node->full_name); 599 599 } ··· 602 602 * Try to request the interrupts 603 603 */ 604 604 605 - if (smu->db_irq != NO_IRQ) { 605 + if (smu->db_irq) { 606 606 if (request_irq(smu->db_irq, smu_db_intr, 607 607 IRQF_SHARED, "SMU doorbell", smu) < 0) { 608 608 printk(KERN_WARNING "SMU: can't " 609 609 "request interrupt %d\n", 610 610 smu->db_irq); 611 - smu->db_irq = NO_IRQ; 611 + smu->db_irq = 0; 612 612 } 613 613 } 614 614 615 - if (smu->msg_irq != NO_IRQ) { 615 + if (smu->msg_irq) { 616 616 if (request_irq(smu->msg_irq, smu_msg_intr, 617 617 IRQF_SHARED, "SMU message", smu) < 0) { 618 618 printk(KERN_WARNING "SMU: can't " 619 619 "request interrupt %d\n", 620 620 smu->msg_irq); 621 - smu->msg_irq = NO_IRQ; 621 + smu->msg_irq = 0; 622 622 } 623 623 } 624 624
+1 -1
drivers/macintosh/via-cuda.c
··· 209 209 cuda_irq = IRQ_MAC_ADB; 210 210 #else 211 211 cuda_irq = irq_of_parse_and_map(vias, 0); 212 - if (cuda_irq == NO_IRQ) { 212 + if (!cuda_irq) { 213 213 printk(KERN_ERR "via-cuda: can't map interrupts for %s\n", 214 214 vias->full_name); 215 215 return -ENODEV;
+3 -3
drivers/macintosh/via-pmu.c
··· 145 145 static int pmu_has_adb; 146 146 static struct device_node *gpio_node; 147 147 static unsigned char __iomem *gpio_reg; 148 - static int gpio_irq = NO_IRQ; 148 + static int gpio_irq = 0; 149 149 static int gpio_irq_enabled = -1; 150 150 static volatile int pmu_suspended; 151 151 static spinlock_t pmu_lock; ··· 402 402 batt_req.complete = 1; 403 403 404 404 irq = irq_of_parse_and_map(vias, 0); 405 - if (irq == NO_IRQ) { 405 + if (!irq) { 406 406 printk(KERN_ERR "via-pmu: can't map interrupt\n"); 407 407 return -ENODEV; 408 408 } ··· 424 424 if (gpio_node) 425 425 gpio_irq = irq_of_parse_and_map(gpio_node, 0); 426 426 427 - if (gpio_irq != NO_IRQ) { 427 + if (gpio_irq) { 428 428 if (request_irq(gpio_irq, gpio1_interrupt, 429 429 IRQF_NO_SUSPEND, "GPIO1 ADB", 430 430 (void *)0))
+2 -2
drivers/ps3/ps3-vuart.c
··· 958 958 959 959 fail_request_irq: 960 960 ps3_vuart_irq_destroy(vuart_bus_priv.virq); 961 - vuart_bus_priv.virq = NO_IRQ; 961 + vuart_bus_priv.virq = 0; 962 962 fail_alloc_irq: 963 963 kfree(vuart_bus_priv.bmp); 964 964 vuart_bus_priv.bmp = NULL; ··· 982 982 free_irq(vuart_bus_priv.virq, &vuart_bus_priv); 983 983 984 984 ps3_vuart_irq_destroy(vuart_bus_priv.virq); 985 - vuart_bus_priv.virq = NO_IRQ; 985 + vuart_bus_priv.virq = 0; 986 986 987 987 kfree(vuart_bus_priv.bmp); 988 988 vuart_bus_priv.bmp = NULL;
+2 -2
sound/aoa/core/gpio-feature.c
··· 118 118 if (np) 119 119 *irqptr = irq_of_parse_and_map(np, 0); 120 120 else 121 - *irqptr = NO_IRQ; 121 + *irqptr = 0; 122 122 } 123 123 124 124 /* 0x4 is outenable, 0x1 is out, thus 4 or 5 */ ··· 336 336 return -EINVAL; 337 337 } 338 338 339 - if (irq == NO_IRQ) 339 + if (!irq) 340 340 return -ENODEV; 341 341 342 342 mutex_lock(&notif->mutex);
+4 -4
sound/ppc/tumbler.c
··· 1303 1303 &mix->line_mute, 1); 1304 1304 irq = tumbler_find_device("headphone-detect", 1305 1305 NULL, &mix->hp_detect, 0); 1306 - if (irq <= NO_IRQ) 1306 + if (irq <= 0) 1307 1307 irq = tumbler_find_device("headphone-detect", 1308 1308 NULL, &mix->hp_detect, 1); 1309 - if (irq <= NO_IRQ) 1309 + if (irq <= 0) 1310 1310 irq = tumbler_find_device("keywest-gpio15", 1311 1311 NULL, &mix->hp_detect, 1); 1312 1312 mix->headphone_irq = irq; 1313 1313 irq = tumbler_find_device("line-output-detect", 1314 1314 NULL, &mix->line_detect, 0); 1315 - if (irq <= NO_IRQ) 1315 + if (irq <= 0) 1316 1316 irq = tumbler_find_device("line-output-detect", 1317 1317 NULL, &mix->line_detect, 1); 1318 - if (IS_G4DA && irq <= NO_IRQ) 1318 + if (IS_G4DA && irq <= 0) 1319 1319 irq = tumbler_find_device("keywest-gpio16", 1320 1320 NULL, &mix->line_detect, 1); 1321 1321 mix->lineout_irq = irq;