diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2016-09-06 07:53:24 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-09-20 06:57:12 -0400 |
commit | ef24ba7091517d2bbf9ba2cb4256c0dccd51d248 (patch) | |
tree | f988a2b82eab1ec83aa2a08e34190a9a32b4035f | |
parent | 9d82fd2fae925efdf546cc25afdc664a2e3a2d9f (diff) |
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>
80 files changed, 204 insertions, 200 deletions
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 0420b388dd83..e02cbc6a6c70 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h | |||
@@ -61,7 +61,7 @@ struct machdep_calls { | |||
61 | 61 | ||
62 | void (*init_IRQ)(void); | 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 | unsigned int (*get_irq)(void); | 65 | unsigned int (*get_irq)(void); |
66 | 66 | ||
67 | /* PCI stuff */ | 67 | /* PCI stuff */ |
diff --git a/arch/powerpc/include/asm/mpic_msgr.h b/arch/powerpc/include/asm/mpic_msgr.h index d4f471fb1031..088420d8aa59 100644 --- a/arch/powerpc/include/asm/mpic_msgr.h +++ b/arch/powerpc/include/asm/mpic_msgr.h | |||
@@ -122,9 +122,9 @@ static inline void mpic_msgr_set_destination(struct mpic_msgr *msgr, | |||
122 | * @msgr: the message register whose IRQ is to be returned | 122 | * @msgr: the message register whose IRQ is to be returned |
123 | * | 123 | * |
124 | * Returns the IRQ number associated with the given message register. | 124 | * Returns the IRQ number associated with the given message register. |
125 | * NO_IRQ is returned if this message register is not capable of | 125 | * 0 is returned if this message register is not capable of receiving |
126 | * receiving interrupts. What message register can and cannot receive | 126 | * interrupts. What message register can and cannot receive interrupts is |
127 | * interrupts is specified in the device tree for the system. | 127 | * specified in the device tree for the system. |
128 | */ | 128 | */ |
129 | static inline int mpic_msgr_get_irq(struct mpic_msgr *msgr) | 129 | static inline int mpic_msgr_get_irq(struct mpic_msgr *msgr) |
130 | { | 130 | { |
diff --git a/arch/powerpc/include/asm/parport.h b/arch/powerpc/include/asm/parport.h index a452968b29ea..6595ad1d18cc 100644 --- a/arch/powerpc/include/asm/parport.h +++ b/arch/powerpc/include/asm/parport.h | |||
@@ -28,7 +28,7 @@ static int parport_pc_find_nonpci_ports (int autoirq, int autodma) | |||
28 | io1 = prop[1]; io2 = prop[2]; | 28 | io1 = prop[1]; io2 = prop[2]; |
29 | 29 | ||
30 | virq = irq_of_parse_and_map(np, 0); | 30 | virq = irq_of_parse_and_map(np, 0); |
31 | if (virq == NO_IRQ) | 31 | if (!virq) |
32 | continue; | 32 | continue; |
33 | 33 | ||
34 | if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0) | 34 | if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0) |
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index c1ca9282f4a0..6ca9a2ffaac7 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c | |||
@@ -227,7 +227,7 @@ int ibmebus_request_irq(u32 ist, irq_handler_t handler, | |||
227 | { | 227 | { |
228 | unsigned int irq = irq_create_mapping(NULL, ist); | 228 | unsigned int irq = irq_create_mapping(NULL, ist); |
229 | 229 | ||
230 | if (irq == NO_IRQ) | 230 | if (!irq) |
231 | return -EINVAL; | 231 | return -EINVAL; |
232 | 232 | ||
233 | return request_irq(irq, handler, irq_flags, devname, dev_id); | 233 | return request_irq(irq, handler, irq_flags, devname, dev_id); |
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 471f65ad1b9b..3c05c311e35e 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -519,7 +519,7 @@ void __do_irq(struct pt_regs *regs) | |||
519 | may_hard_irq_enable(); | 519 | may_hard_irq_enable(); |
520 | 520 | ||
521 | /* And finally process it */ | 521 | /* And finally process it */ |
522 | if (unlikely(irq == NO_IRQ)) | 522 | if (unlikely(!irq)) |
523 | __this_cpu_inc(irq_stat.spurious_irqs); | 523 | __this_cpu_inc(irq_stat.spurious_irqs); |
524 | else | 524 | else |
525 | generic_handle_irq(irq); | 525 | generic_handle_irq(irq); |
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 7b750c4ed5c7..bc525ea0dc09 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c | |||
@@ -193,10 +193,10 @@ static int __init add_legacy_soc_port(struct device_node *np, | |||
193 | */ | 193 | */ |
194 | if (tsi && !strcmp(tsi->type, "tsi-bridge")) | 194 | if (tsi && !strcmp(tsi->type, "tsi-bridge")) |
195 | return add_legacy_port(np, -1, UPIO_TSI, addr, addr, | 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 | else | 197 | else |
198 | return add_legacy_port(np, -1, UPIO_MEM, addr, addr, | 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 | static int __init add_legacy_isa_port(struct device_node *np, | 202 | 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, | |||
242 | 242 | ||
243 | /* Add port, irq will be dealt with later */ | 243 | /* Add port, irq will be dealt with later */ |
244 | return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]), | 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,7 +314,7 @@ static int __init add_legacy_pci_port(struct device_node *np, | |||
314 | /* Add port, irq will be dealt with later. We passed a translated | 314 | /* Add port, irq will be dealt with later. We passed a translated |
315 | * IO port value. It will be fixed up later along with the irq | 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 | legacy_port_flags, np != pci_dev); | 318 | legacy_port_flags, np != pci_dev); |
319 | } | 319 | } |
320 | #endif | 320 | #endif |
@@ -462,14 +462,14 @@ static void __init fixup_port_irq(int index, | |||
462 | DBG("fixup_port_irq(%d)\n", index); | 462 | DBG("fixup_port_irq(%d)\n", index); |
463 | 463 | ||
464 | virq = irq_of_parse_and_map(np, 0); | 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 | np = of_get_parent(np); | 466 | np = of_get_parent(np); |
467 | if (np == NULL) | 467 | if (np == NULL) |
468 | return; | 468 | return; |
469 | virq = irq_of_parse_and_map(np, 0); | 469 | virq = irq_of_parse_and_map(np, 0); |
470 | of_node_put(np); | 470 | of_node_put(np); |
471 | } | 471 | } |
472 | if (virq == NO_IRQ) | 472 | if (!virq) |
473 | return; | 473 | return; |
474 | 474 | ||
475 | port->irq = virq; | 475 | port->irq = virq; |
@@ -543,7 +543,7 @@ static int __init serial_dev_init(void) | |||
543 | struct plat_serial8250_port *port = &legacy_serial_ports[i]; | 543 | struct plat_serial8250_port *port = &legacy_serial_ports[i]; |
544 | struct device_node *np = legacy_serial_infos[i].np; | 544 | struct device_node *np = legacy_serial_infos[i].np; |
545 | 545 | ||
546 | if (port->irq == NO_IRQ) | 546 | if (!port->irq) |
547 | fixup_port_irq(i, np, port); | 547 | fixup_port_irq(i, np, port); |
548 | if (port->iotype == UPIO_PORT) | 548 | if (port->iotype == UPIO_PORT) |
549 | fixup_port_pio(i, np, port); | 549 | fixup_port_pio(i, np, port); |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index e58908066b0e..95d3769a2e26 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -360,7 +360,7 @@ static int pci_read_irq_line(struct pci_dev *pci_dev) | |||
360 | line, pin); | 360 | line, pin); |
361 | 361 | ||
362 | virq = irq_create_mapping(NULL, line); | 362 | virq = irq_create_mapping(NULL, line); |
363 | if (virq != NO_IRQ) | 363 | if (virq) |
364 | irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); | 364 | irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); |
365 | } else { | 365 | } else { |
366 | pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n", | 366 | 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) | |||
369 | 369 | ||
370 | virq = irq_create_of_mapping(&oirq); | 370 | virq = irq_create_of_mapping(&oirq); |
371 | } | 371 | } |
372 | if(virq == NO_IRQ) { | 372 | |
373 | if (!virq) { | ||
373 | pr_debug(" Failed to map !\n"); | 374 | pr_debug(" Failed to map !\n"); |
374 | return -1; | 375 | return -1; |
375 | } | 376 | } |
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c index 526ac6750e4d..ea3d98115b88 100644 --- a/arch/powerpc/kernel/pci_of_scan.c +++ b/arch/powerpc/kernel/pci_of_scan.c | |||
@@ -178,7 +178,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, | |||
178 | dev->hdr_type = PCI_HEADER_TYPE_NORMAL; | 178 | dev->hdr_type = PCI_HEADER_TYPE_NORMAL; |
179 | dev->rom_base_reg = PCI_ROM_ADDRESS; | 179 | dev->rom_base_reg = PCI_ROM_ADDRESS; |
180 | /* Maybe do a default OF mapping here */ | 180 | /* Maybe do a default OF mapping here */ |
181 | dev->irq = NO_IRQ; | 181 | dev->irq = 0; |
182 | } | 182 | } |
183 | 183 | ||
184 | of_pci_parse_addrs(node, dev); | 184 | of_pci_parse_addrs(node, dev); |
diff --git a/arch/powerpc/platforms/44x/warp.c b/arch/powerpc/platforms/44x/warp.c index 5ecce543103e..a886c2c22097 100644 --- a/arch/powerpc/platforms/44x/warp.c +++ b/arch/powerpc/platforms/44x/warp.c | |||
@@ -204,7 +204,7 @@ static void pika_setup_critical_temp(struct device_node *np, | |||
204 | i2c_smbus_write_byte_data(client, 3, 0); /* Tlow */ | 204 | i2c_smbus_write_byte_data(client, 3, 0); /* Tlow */ |
205 | 205 | ||
206 | irq = irq_of_parse_and_map(np, 0); | 206 | irq = irq_of_parse_and_map(np, 0); |
207 | if (irq == NO_IRQ) { | 207 | if (!irq) { |
208 | printk(KERN_ERR __FILE__ ": Unable to get ad7414 irq\n"); | 208 | printk(KERN_ERR __FILE__ ": Unable to get ad7414 irq\n"); |
209 | return; | 209 | return; |
210 | } | 210 | } |
diff --git a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c b/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c index 0035d146df73..fe4d4eac7427 100644 --- a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c +++ b/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c | |||
@@ -97,7 +97,7 @@ cpld_pic_get_irq(int offset, u8 ignore, u8 __iomem *statusp, | |||
97 | status |= (ignore | mask); | 97 | status |= (ignore | mask); |
98 | 98 | ||
99 | if (status == 0xff) | 99 | if (status == 0xff) |
100 | return NO_IRQ; | 100 | return 0; |
101 | 101 | ||
102 | cpld_irq = ffz(status) + offset; | 102 | cpld_irq = ffz(status) + offset; |
103 | 103 | ||
@@ -110,14 +110,14 @@ static void cpld_pic_cascade(struct irq_desc *desc) | |||
110 | 110 | ||
111 | irq = cpld_pic_get_irq(0, PCI_IGNORE, &cpld_regs->pci_status, | 111 | irq = cpld_pic_get_irq(0, PCI_IGNORE, &cpld_regs->pci_status, |
112 | &cpld_regs->pci_mask); | 112 | &cpld_regs->pci_mask); |
113 | if (irq != NO_IRQ) { | 113 | if (irq) { |
114 | generic_handle_irq(irq); | 114 | generic_handle_irq(irq); |
115 | return; | 115 | return; |
116 | } | 116 | } |
117 | 117 | ||
118 | irq = cpld_pic_get_irq(8, MISC_IGNORE, &cpld_regs->misc_status, | 118 | irq = cpld_pic_get_irq(8, MISC_IGNORE, &cpld_regs->misc_status, |
119 | &cpld_regs->misc_mask); | 119 | &cpld_regs->misc_mask); |
120 | if (irq != NO_IRQ) { | 120 | if (irq) { |
121 | generic_handle_irq(irq); | 121 | generic_handle_irq(irq); |
122 | return; | 122 | return; |
123 | } | 123 | } |
@@ -177,7 +177,7 @@ mpc5121_ads_cpld_pic_init(void) | |||
177 | goto end; | 177 | goto end; |
178 | 178 | ||
179 | cascade_irq = irq_of_parse_and_map(np, 0); | 179 | cascade_irq = irq_of_parse_and_map(np, 0); |
180 | if (cascade_irq == NO_IRQ) | 180 | if (!cascade_irq) |
181 | goto end; | 181 | goto end; |
182 | 182 | ||
183 | /* | 183 | /* |
diff --git a/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c b/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c index d93dd4acf40b..cec3f88f153d 100644 --- a/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c +++ b/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c | |||
@@ -473,7 +473,7 @@ static int mpc512x_lpbfifo_probe(struct platform_device *pdev) | |||
473 | } | 473 | } |
474 | 474 | ||
475 | lpbfifo.irq = irq_of_parse_and_map(pdev->dev.of_node, 0); | 475 | lpbfifo.irq = irq_of_parse_and_map(pdev->dev.of_node, 0); |
476 | if (lpbfifo.irq == NO_IRQ) { | 476 | if (!lpbfifo.irq) { |
477 | dev_err(&pdev->dev, "mapping irq failed\n"); | 477 | dev_err(&pdev->dev, "mapping irq failed\n"); |
478 | ret = -ENODEV; | 478 | ret = -ENODEV; |
479 | goto err0; | 479 | goto err0; |
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c index 4fe2074c88cb..fc98912f42cf 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c | |||
@@ -511,7 +511,7 @@ unsigned int mpc52xx_get_irq(void) | |||
511 | irq |= (MPC52xx_IRQ_L1_PERP << MPC52xx_IRQ_L1_OFFSET); | 511 | irq |= (MPC52xx_IRQ_L1_PERP << MPC52xx_IRQ_L1_OFFSET); |
512 | } | 512 | } |
513 | } else { | 513 | } else { |
514 | return NO_IRQ; | 514 | return 0; |
515 | } | 515 | } |
516 | 516 | ||
517 | return irq_linear_revmap(mpc52xx_irqhost, irq); | 517 | return irq_linear_revmap(mpc52xx_irqhost, irq); |
diff --git a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c index 60e89fc9c753..8b065bdf7412 100644 --- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c +++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | |||
@@ -131,7 +131,7 @@ int __init pq2ads_pci_init_irq(void) | |||
131 | } | 131 | } |
132 | 132 | ||
133 | irq = irq_of_parse_and_map(np, 0); | 133 | irq = irq_of_parse_and_map(np, 0); |
134 | if (irq == NO_IRQ) { | 134 | if (!irq) { |
135 | printk(KERN_ERR "No interrupt in pci pic node.\n"); | 135 | printk(KERN_ERR "No interrupt in pci pic node.\n"); |
136 | of_node_put(np); | 136 | of_node_put(np); |
137 | goto out; | 137 | goto out; |
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c index 2ef03e7d248c..0d6a62fc5864 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c | |||
@@ -89,7 +89,7 @@ static int __init of_fsl_spi_probe(char *type, char *compatible, u32 sysclk, | |||
89 | goto err; | 89 | goto err; |
90 | 90 | ||
91 | ret = of_irq_to_resource(np, 0, &res[1]); | 91 | ret = of_irq_to_resource(np, 0, &res[1]); |
92 | if (ret == NO_IRQ) | 92 | if (!ret) |
93 | goto err; | 93 | goto err; |
94 | 94 | ||
95 | pdev = platform_device_alloc("mpc83xx_spi", i); | 95 | pdev = platform_device_alloc("mpc83xx_spi", i); |
diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c index fcbea4b51a78..24717d060008 100644 --- a/arch/powerpc/platforms/83xx/suspend.c +++ b/arch/powerpc/platforms/83xx/suspend.c | |||
@@ -352,7 +352,7 @@ static int pmc_probe(struct platform_device *ofdev) | |||
352 | return -ENODEV; | 352 | return -ENODEV; |
353 | 353 | ||
354 | pmc_irq = irq_of_parse_and_map(np, 0); | 354 | pmc_irq = irq_of_parse_and_map(np, 0); |
355 | if (pmc_irq != NO_IRQ) { | 355 | if (pmc_irq) { |
356 | ret = request_irq(pmc_irq, pmc_irq_handler, IRQF_SHARED, | 356 | ret = request_irq(pmc_irq, pmc_irq_handler, IRQF_SHARED, |
357 | "pmc", ofdev); | 357 | "pmc", ofdev); |
358 | 358 | ||
@@ -400,7 +400,7 @@ out_syscr: | |||
400 | out_pmc: | 400 | out_pmc: |
401 | iounmap(pmc_regs); | 401 | iounmap(pmc_regs); |
402 | out: | 402 | out: |
403 | if (pmc_irq != NO_IRQ) | 403 | if (pmc_irq) |
404 | free_irq(pmc_irq, ofdev); | 404 | free_irq(pmc_irq, ofdev); |
405 | 405 | ||
406 | return ret; | 406 | return ret; |
diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c index 28720a4ded7b..954e5e8b14ef 100644 --- a/arch/powerpc/platforms/85xx/common.c +++ b/arch/powerpc/platforms/85xx/common.c | |||
@@ -76,7 +76,7 @@ void __init mpc85xx_cpm2_pic_init(void) | |||
76 | return; | 76 | return; |
77 | } | 77 | } |
78 | irq = irq_of_parse_and_map(np, 0); | 78 | irq = irq_of_parse_and_map(np, 0); |
79 | if (irq == NO_IRQ) { | 79 | if (!irq) { |
80 | of_node_put(np); | 80 | of_node_put(np); |
81 | printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n"); | 81 | printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n"); |
82 | return; | 82 | return; |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c index 62f171c71c4c..86f20156178e 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c | |||
@@ -196,7 +196,7 @@ static void mpc85xx_8259_cascade_handler(struct irq_desc *desc) | |||
196 | { | 196 | { |
197 | unsigned int cascade_irq = i8259_irq(); | 197 | unsigned int cascade_irq = i8259_irq(); |
198 | 198 | ||
199 | if (cascade_irq != NO_IRQ) | 199 | if (cascade_irq) |
200 | /* handle an interrupt from the 8259 */ | 200 | /* handle an interrupt from the 8259 */ |
201 | generic_handle_irq(cascade_irq); | 201 | generic_handle_irq(cascade_irq); |
202 | 202 | ||
@@ -247,7 +247,7 @@ static int mpc85xx_cds_8259_attach(void) | |||
247 | } | 247 | } |
248 | 248 | ||
249 | cascade_irq = irq_of_parse_and_map(cascade_node, 0); | 249 | cascade_irq = irq_of_parse_and_map(cascade_node, 0); |
250 | if (cascade_irq == NO_IRQ) { | 250 | if (!cascade_irq) { |
251 | printk(KERN_ERR "Failed to map cascade interrupt\n"); | 251 | printk(KERN_ERR "Failed to map cascade interrupt\n"); |
252 | return -ENXIO; | 252 | return -ENXIO; |
253 | } | 253 | } |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index 6bc07d837b1c..ed69c7ee1829 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c | |||
@@ -51,7 +51,7 @@ static void mpc85xx_8259_cascade(struct irq_desc *desc) | |||
51 | struct irq_chip *chip = irq_desc_get_chip(desc); | 51 | struct irq_chip *chip = irq_desc_get_chip(desc); |
52 | unsigned int cascade_irq = i8259_irq(); | 52 | unsigned int cascade_irq = i8259_irq(); |
53 | 53 | ||
54 | if (cascade_irq != NO_IRQ) { | 54 | if (cascade_irq) { |
55 | generic_handle_irq(cascade_irq); | 55 | generic_handle_irq(cascade_irq); |
56 | } | 56 | } |
57 | chip->irq_eoi(&desc->irq_data); | 57 | chip->irq_eoi(&desc->irq_data); |
@@ -96,7 +96,7 @@ void __init mpc85xx_ds_pic_init(void) | |||
96 | } | 96 | } |
97 | 97 | ||
98 | cascade_irq = irq_of_parse_and_map(cascade_node, 0); | 98 | cascade_irq = irq_of_parse_and_map(cascade_node, 0); |
99 | if (cascade_irq == NO_IRQ) { | 99 | if (!cascade_irq) { |
100 | printk(KERN_ERR "Failed to map cascade interrupt\n"); | 100 | printk(KERN_ERR "Failed to map cascade interrupt\n"); |
101 | return; | 101 | return; |
102 | } | 102 | } |
diff --git a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c index b02d6a5bb035..82f8490b5aa7 100644 --- a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c +++ b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c | |||
@@ -78,7 +78,7 @@ static inline unsigned int socrates_fpga_pic_get_irq(unsigned int irq) | |||
78 | break; | 78 | break; |
79 | } | 79 | } |
80 | if (i == 3) | 80 | if (i == 3) |
81 | return NO_IRQ; | 81 | return 0; |
82 | 82 | ||
83 | raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); | 83 | raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); |
84 | cause = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(i)); | 84 | cause = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(i)); |
@@ -103,7 +103,7 @@ static void socrates_fpga_pic_cascade(struct irq_desc *desc) | |||
103 | */ | 103 | */ |
104 | cascade_irq = socrates_fpga_pic_get_irq(irq); | 104 | cascade_irq = socrates_fpga_pic_get_irq(irq); |
105 | 105 | ||
106 | if (cascade_irq != NO_IRQ) | 106 | if (cascade_irq) |
107 | generic_handle_irq(cascade_irq); | 107 | generic_handle_irq(cascade_irq); |
108 | chip->irq_eoi(&desc->irq_data); | 108 | chip->irq_eoi(&desc->irq_data); |
109 | } | 109 | } |
@@ -292,7 +292,7 @@ void socrates_fpga_pic_init(struct device_node *pic) | |||
292 | 292 | ||
293 | for (i = 0; i < 3; i++) { | 293 | for (i = 0; i < 3; i++) { |
294 | socrates_fpga_irqs[i] = irq_of_parse_and_map(pic, i); | 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 | pr_warning("FPGA PIC: can't get irq%d.\n", i); | 296 | pr_warning("FPGA PIC: can't get irq%d.\n", i); |
297 | continue; | 297 | continue; |
298 | } | 298 | } |
diff --git a/arch/powerpc/platforms/86xx/pic.c b/arch/powerpc/platforms/86xx/pic.c index 845defa1fd19..a6c695fa4da0 100644 --- a/arch/powerpc/platforms/86xx/pic.c +++ b/arch/powerpc/platforms/86xx/pic.c | |||
@@ -22,7 +22,7 @@ static void mpc86xx_8259_cascade(struct irq_desc *desc) | |||
22 | struct irq_chip *chip = irq_desc_get_chip(desc); | 22 | struct irq_chip *chip = irq_desc_get_chip(desc); |
23 | unsigned int cascade_irq = i8259_irq(); | 23 | unsigned int cascade_irq = i8259_irq(); |
24 | 24 | ||
25 | if (cascade_irq != NO_IRQ) | 25 | if (cascade_irq) |
26 | generic_handle_irq(cascade_irq); | 26 | generic_handle_irq(cascade_irq); |
27 | 27 | ||
28 | chip->irq_eoi(&desc->irq_data); | 28 | chip->irq_eoi(&desc->irq_data); |
@@ -58,7 +58,7 @@ void __init mpc86xx_init_irq(void) | |||
58 | } | 58 | } |
59 | 59 | ||
60 | cascade_irq = irq_of_parse_and_map(cascade_node, 0); | 60 | cascade_irq = irq_of_parse_and_map(cascade_node, 0); |
61 | if (cascade_irq == NO_IRQ) { | 61 | if (!cascade_irq) { |
62 | printk(KERN_ERR "Failed to map cascade interrupt\n"); | 62 | printk(KERN_ERR "Failed to map cascade interrupt\n"); |
63 | return; | 63 | return; |
64 | } | 64 | } |
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index b1ab6e96cb31..f81069f79a94 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c | |||
@@ -241,6 +241,6 @@ void __init mpc8xx_pics_init(void) | |||
241 | } | 241 | } |
242 | 242 | ||
243 | irq = cpm_pic_init(); | 243 | irq = cpm_pic_init(); |
244 | if (irq != NO_IRQ) | 244 | if (irq) |
245 | irq_set_chained_handler(irq, cpm_cascade); | 245 | irq_set_chained_handler(irq, cpm_cascade); |
246 | } | 246 | } |
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c index aed7714495c1..8b55c5f19d4c 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c | |||
@@ -271,7 +271,7 @@ static int axon_msi_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
271 | 271 | ||
272 | for_each_pci_msi_entry(entry, dev) { | 272 | for_each_pci_msi_entry(entry, dev) { |
273 | virq = irq_create_direct_mapping(msic->irq_domain); | 273 | virq = irq_create_direct_mapping(msic->irq_domain); |
274 | if (virq == NO_IRQ) { | 274 | if (!virq) { |
275 | dev_warn(&dev->dev, | 275 | dev_warn(&dev->dev, |
276 | "axon_msi: virq allocation failed!\n"); | 276 | "axon_msi: virq allocation failed!\n"); |
277 | return -1; | 277 | return -1; |
@@ -293,7 +293,7 @@ static void axon_msi_teardown_msi_irqs(struct pci_dev *dev) | |||
293 | dev_dbg(&dev->dev, "axon_msi: tearing down msi irqs\n"); | 293 | dev_dbg(&dev->dev, "axon_msi: tearing down msi irqs\n"); |
294 | 294 | ||
295 | for_each_pci_msi_entry(entry, dev) { | 295 | for_each_pci_msi_entry(entry, dev) { |
296 | if (entry->irq == NO_IRQ) | 296 | if (!entry->irq) |
297 | continue; | 297 | continue; |
298 | 298 | ||
299 | irq_set_msi_desc(entry->irq, NULL); | 299 | irq_set_msi_desc(entry->irq, NULL); |
@@ -375,7 +375,7 @@ static int axon_msi_probe(struct platform_device *device) | |||
375 | } | 375 | } |
376 | 376 | ||
377 | virq = irq_of_parse_and_map(dn, 0); | 377 | virq = irq_of_parse_and_map(dn, 0); |
378 | if (virq == NO_IRQ) { | 378 | if (!virq) { |
379 | printk(KERN_ERR "axon_msi: irq parse and map failed for %s\n", | 379 | printk(KERN_ERR "axon_msi: irq parse and map failed for %s\n", |
380 | dn->full_name); | 380 | dn->full_name); |
381 | goto out_free_fifo; | 381 | goto out_free_fifo; |
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c index 4d16b368b6f5..a6bbbaba14a3 100644 --- a/arch/powerpc/platforms/cell/interrupt.c +++ b/arch/powerpc/platforms/cell/interrupt.c | |||
@@ -123,7 +123,7 @@ static void iic_ioexc_cascade(struct irq_desc *desc) | |||
123 | unsigned int cirq = | 123 | unsigned int cirq = |
124 | irq_linear_revmap(iic_host, | 124 | irq_linear_revmap(iic_host, |
125 | base | cascade); | 125 | base | cascade); |
126 | if (cirq != NO_IRQ) | 126 | if (cirq) |
127 | generic_handle_irq(cirq); | 127 | generic_handle_irq(cirq); |
128 | } | 128 | } |
129 | /* post-ack level interrupts */ | 129 | /* post-ack level interrupts */ |
@@ -153,10 +153,10 @@ static unsigned int iic_get_irq(void) | |||
153 | *(unsigned long *) &pending = | 153 | *(unsigned long *) &pending = |
154 | in_be64((u64 __iomem *) &iic->regs->pending_destr); | 154 | in_be64((u64 __iomem *) &iic->regs->pending_destr); |
155 | if (!(pending.flags & CBE_IIC_IRQ_VALID)) | 155 | if (!(pending.flags & CBE_IIC_IRQ_VALID)) |
156 | return NO_IRQ; | 156 | return 0; |
157 | virq = irq_linear_revmap(iic_host, iic_pending_to_hwnum(pending)); | 157 | virq = irq_linear_revmap(iic_host, iic_pending_to_hwnum(pending)); |
158 | if (virq == NO_IRQ) | 158 | if (!virq) |
159 | return NO_IRQ; | 159 | return 0; |
160 | iic->eoi_stack[++iic->eoi_ptr] = pending.prio; | 160 | iic->eoi_stack[++iic->eoi_ptr] = pending.prio; |
161 | BUG_ON(iic->eoi_ptr > 15); | 161 | BUG_ON(iic->eoi_ptr > 15); |
162 | return virq; | 162 | return virq; |
@@ -192,7 +192,7 @@ static void iic_request_ipi(int msg) | |||
192 | int virq; | 192 | int virq; |
193 | 193 | ||
194 | virq = irq_create_mapping(iic_host, iic_msg_to_irq(msg)); | 194 | virq = irq_create_mapping(iic_host, iic_msg_to_irq(msg)); |
195 | if (virq == NO_IRQ) { | 195 | if (!virq) { |
196 | printk(KERN_ERR | 196 | printk(KERN_ERR |
197 | "iic: failed to map IPI %s\n", smp_ipi_name[msg]); | 197 | "iic: failed to map IPI %s\n", smp_ipi_name[msg]); |
198 | return; | 198 | return; |
@@ -347,7 +347,7 @@ static int __init setup_iic(void) | |||
347 | cascade |= 1 << IIC_IRQ_CLASS_SHIFT; | 347 | cascade |= 1 << IIC_IRQ_CLASS_SHIFT; |
348 | cascade |= IIC_UNIT_IIC; | 348 | cascade |= IIC_UNIT_IIC; |
349 | cascade = irq_create_mapping(iic_host, cascade); | 349 | cascade = irq_create_mapping(iic_host, cascade); |
350 | if (cascade == NO_IRQ) | 350 | if (!cascade) |
351 | continue; | 351 | continue; |
352 | /* | 352 | /* |
353 | * irq_data is a generic pointer that gets passed back | 353 | * irq_data is a generic pointer that gets passed back |
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index 640772af9bcb..7ff51f96a00e 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -411,7 +411,7 @@ static void cell_iommu_enable_hardware(struct cbe_iommu *iommu) | |||
411 | 411 | ||
412 | virq = irq_create_mapping(NULL, | 412 | virq = irq_create_mapping(NULL, |
413 | IIC_IRQ_IOEX_ATI | (iommu->nid << IIC_IRQ_NODE_SHIFT)); | 413 | IIC_IRQ_IOEX_ATI | (iommu->nid << IIC_IRQ_NODE_SHIFT)); |
414 | BUG_ON(virq == NO_IRQ); | 414 | BUG_ON(!virq); |
415 | 415 | ||
416 | ret = request_irq(virq, ioc_interrupt, 0, iommu->name, iommu); | 416 | ret = request_irq(virq, ioc_interrupt, 0, iommu->name, iommu); |
417 | BUG_ON(ret); | 417 | BUG_ON(ret); |
diff --git a/arch/powerpc/platforms/cell/pmu.c b/arch/powerpc/platforms/cell/pmu.c index 348a27b12512..e3ad0c38f017 100644 --- a/arch/powerpc/platforms/cell/pmu.c +++ b/arch/powerpc/platforms/cell/pmu.c | |||
@@ -385,7 +385,7 @@ static int __init cbe_init_pm_irq(void) | |||
385 | for_each_online_node(node) { | 385 | for_each_online_node(node) { |
386 | irq = irq_create_mapping(NULL, IIC_IRQ_IOEX_PMI | | 386 | irq = irq_create_mapping(NULL, IIC_IRQ_IOEX_PMI | |
387 | (node << IIC_IRQ_NODE_SHIFT)); | 387 | (node << IIC_IRQ_NODE_SHIFT)); |
388 | if (irq == NO_IRQ) { | 388 | if (!irq) { |
389 | printk("ERROR: Unable to allocate irq for node %d\n", | 389 | printk("ERROR: Unable to allocate irq for node %d\n", |
390 | node); | 390 | node); |
391 | return -EINVAL; | 391 | return -EINVAL; |
@@ -412,7 +412,7 @@ void cbe_sync_irq(int node) | |||
412 | IIC_IRQ_IOEX_PMI | 412 | IIC_IRQ_IOEX_PMI |
413 | | (node << IIC_IRQ_NODE_SHIFT)); | 413 | | (node << IIC_IRQ_NODE_SHIFT)); |
414 | 414 | ||
415 | if (irq == NO_IRQ) { | 415 | if (!irq) { |
416 | printk(KERN_WARNING "ERROR, unable to get existing irq %d " \ | 416 | printk(KERN_WARNING "ERROR, unable to get existing irq %d " \ |
417 | "for node %d\n", irq, node); | 417 | "for node %d\n", irq, node); |
418 | return; | 418 | return; |
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c index d06dcac66fcb..ff924af00e78 100644 --- a/arch/powerpc/platforms/cell/spider-pic.c +++ b/arch/powerpc/platforms/cell/spider-pic.c | |||
@@ -207,11 +207,11 @@ static void spider_irq_cascade(struct irq_desc *desc) | |||
207 | 207 | ||
208 | cs = in_be32(pic->regs + TIR_CS) >> 24; | 208 | cs = in_be32(pic->regs + TIR_CS) >> 24; |
209 | if (cs == SPIDER_IRQ_INVALID) | 209 | if (cs == SPIDER_IRQ_INVALID) |
210 | virq = NO_IRQ; | 210 | virq = 0; |
211 | else | 211 | else |
212 | virq = irq_linear_revmap(pic->host, cs); | 212 | virq = irq_linear_revmap(pic->host, cs); |
213 | 213 | ||
214 | if (virq != NO_IRQ) | 214 | if (virq) |
215 | generic_handle_irq(virq); | 215 | generic_handle_irq(virq); |
216 | 216 | ||
217 | chip->irq_eoi(&desc->irq_data); | 217 | chip->irq_eoi(&desc->irq_data); |
@@ -245,19 +245,19 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic) | |||
245 | /* Now do the horrible hacks */ | 245 | /* Now do the horrible hacks */ |
246 | tmp = of_get_property(of_node, "#interrupt-cells", NULL); | 246 | tmp = of_get_property(of_node, "#interrupt-cells", NULL); |
247 | if (tmp == NULL) | 247 | if (tmp == NULL) |
248 | return NO_IRQ; | 248 | return 0; |
249 | intsize = *tmp; | 249 | intsize = *tmp; |
250 | imap = of_get_property(of_node, "interrupt-map", &imaplen); | 250 | imap = of_get_property(of_node, "interrupt-map", &imaplen); |
251 | if (imap == NULL || imaplen < (intsize + 1)) | 251 | if (imap == NULL || imaplen < (intsize + 1)) |
252 | return NO_IRQ; | 252 | return 0; |
253 | iic = of_find_node_by_phandle(imap[intsize]); | 253 | iic = of_find_node_by_phandle(imap[intsize]); |
254 | if (iic == NULL) | 254 | if (iic == NULL) |
255 | return NO_IRQ; | 255 | return 0; |
256 | imap += intsize + 1; | 256 | imap += intsize + 1; |
257 | tmp = of_get_property(iic, "#interrupt-cells", NULL); | 257 | tmp = of_get_property(iic, "#interrupt-cells", NULL); |
258 | if (tmp == NULL) { | 258 | if (tmp == NULL) { |
259 | of_node_put(iic); | 259 | of_node_put(iic); |
260 | return NO_IRQ; | 260 | return 0; |
261 | } | 261 | } |
262 | intsize = *tmp; | 262 | intsize = *tmp; |
263 | /* Assume unit is last entry of interrupt specifier */ | 263 | /* 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) | |||
266 | tmp = of_get_property(iic, "ibm,interrupt-server-ranges", NULL); | 266 | tmp = of_get_property(iic, "ibm,interrupt-server-ranges", NULL); |
267 | if (tmp == NULL) { | 267 | if (tmp == NULL) { |
268 | of_node_put(iic); | 268 | of_node_put(iic); |
269 | return NO_IRQ; | 269 | return 0; |
270 | } | 270 | } |
271 | /* ugly as hell but works for now */ | 271 | /* ugly as hell but works for now */ |
272 | pic->node_id = (*tmp) >> 1; | 272 | pic->node_id = (*tmp) >> 1; |
@@ -281,7 +281,7 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic) | |||
281 | (pic->node_id << IIC_IRQ_NODE_SHIFT) | | 281 | (pic->node_id << IIC_IRQ_NODE_SHIFT) | |
282 | (2 << IIC_IRQ_CLASS_SHIFT) | | 282 | (2 << IIC_IRQ_CLASS_SHIFT) | |
283 | unit); | 283 | unit); |
284 | if (virq == NO_IRQ) | 284 | if (!virq) |
285 | printk(KERN_ERR "spider_pic: failed to map cascade !"); | 285 | printk(KERN_ERR "spider_pic: failed to map cascade !"); |
286 | return virq; | 286 | return virq; |
287 | } | 287 | } |
@@ -318,7 +318,7 @@ static void __init spider_init_one(struct device_node *of_node, int chip, | |||
318 | 318 | ||
319 | /* Hook up the cascade interrupt to the iic and nodeid */ | 319 | /* Hook up the cascade interrupt to the iic and nodeid */ |
320 | virq = spider_find_cascade_and_node(pic); | 320 | virq = spider_find_cascade_and_node(pic); |
321 | if (virq == NO_IRQ) | 321 | if (!virq) |
322 | return; | 322 | return; |
323 | irq_set_handler_data(virq, pic); | 323 | irq_set_handler_data(virq, pic); |
324 | irq_set_chained_handler(virq, spider_irq_cascade); | 324 | irq_set_chained_handler(virq, spider_irq_cascade); |
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index bb4a8e07c229..e84d8fbc2e21 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -402,7 +402,7 @@ static int spu_request_irqs(struct spu *spu) | |||
402 | { | 402 | { |
403 | int ret = 0; | 403 | int ret = 0; |
404 | 404 | ||
405 | if (spu->irqs[0] != NO_IRQ) { | 405 | if (spu->irqs[0]) { |
406 | snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", | 406 | snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", |
407 | spu->number); | 407 | spu->number); |
408 | ret = request_irq(spu->irqs[0], spu_irq_class_0, | 408 | ret = request_irq(spu->irqs[0], spu_irq_class_0, |
@@ -410,7 +410,7 @@ static int spu_request_irqs(struct spu *spu) | |||
410 | if (ret) | 410 | if (ret) |
411 | goto bail0; | 411 | goto bail0; |
412 | } | 412 | } |
413 | if (spu->irqs[1] != NO_IRQ) { | 413 | if (spu->irqs[1]) { |
414 | snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", | 414 | snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", |
415 | spu->number); | 415 | spu->number); |
416 | ret = request_irq(spu->irqs[1], spu_irq_class_1, | 416 | ret = request_irq(spu->irqs[1], spu_irq_class_1, |
@@ -418,7 +418,7 @@ static int spu_request_irqs(struct spu *spu) | |||
418 | if (ret) | 418 | if (ret) |
419 | goto bail1; | 419 | goto bail1; |
420 | } | 420 | } |
421 | if (spu->irqs[2] != NO_IRQ) { | 421 | if (spu->irqs[2]) { |
422 | snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", | 422 | snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", |
423 | spu->number); | 423 | spu->number); |
424 | ret = request_irq(spu->irqs[2], spu_irq_class_2, | 424 | ret = request_irq(spu->irqs[2], spu_irq_class_2, |
@@ -429,10 +429,10 @@ static int spu_request_irqs(struct spu *spu) | |||
429 | return 0; | 429 | return 0; |
430 | 430 | ||
431 | bail2: | 431 | bail2: |
432 | if (spu->irqs[1] != NO_IRQ) | 432 | if (spu->irqs[1]) |
433 | free_irq(spu->irqs[1], spu); | 433 | free_irq(spu->irqs[1], spu); |
434 | bail1: | 434 | bail1: |
435 | if (spu->irqs[0] != NO_IRQ) | 435 | if (spu->irqs[0]) |
436 | free_irq(spu->irqs[0], spu); | 436 | free_irq(spu->irqs[0], spu); |
437 | bail0: | 437 | bail0: |
438 | return ret; | 438 | return ret; |
@@ -440,11 +440,11 @@ bail0: | |||
440 | 440 | ||
441 | static void spu_free_irqs(struct spu *spu) | 441 | static void spu_free_irqs(struct spu *spu) |
442 | { | 442 | { |
443 | if (spu->irqs[0] != NO_IRQ) | 443 | if (spu->irqs[0]) |
444 | free_irq(spu->irqs[0], spu); | 444 | free_irq(spu->irqs[0], spu); |
445 | if (spu->irqs[1] != NO_IRQ) | 445 | if (spu->irqs[1]) |
446 | free_irq(spu->irqs[1], spu); | 446 | free_irq(spu->irqs[1], spu); |
447 | if (spu->irqs[2] != NO_IRQ) | 447 | if (spu->irqs[2]) |
448 | free_irq(spu->irqs[2], spu); | 448 | free_irq(spu->irqs[2], spu); |
449 | } | 449 | } |
450 | 450 | ||
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c index 21b4bfb97200..672d310dcf14 100644 --- a/arch/powerpc/platforms/cell/spu_manage.c +++ b/arch/powerpc/platforms/cell/spu_manage.c | |||
@@ -105,7 +105,10 @@ static int __init spu_map_interrupts_old(struct spu *spu, | |||
105 | spu->irqs[2] = irq_create_mapping(NULL, IIC_IRQ_CLASS_2 | isrc); | 105 | spu->irqs[2] = irq_create_mapping(NULL, IIC_IRQ_CLASS_2 | isrc); |
106 | 106 | ||
107 | /* Right now, we only fail if class 2 failed */ | 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 | static void __iomem * __init spu_map_prop_old(struct spu *spu, | 114 | 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) | |||
191 | pr_debug(" irq %d no 0x%x on %s\n", i, oirq.args[0], | 194 | pr_debug(" irq %d no 0x%x on %s\n", i, oirq.args[0], |
192 | oirq.np->full_name); | 195 | oirq.np->full_name); |
193 | spu->irqs[i] = irq_create_of_mapping(&oirq); | 196 | spu->irqs[i] = irq_create_of_mapping(&oirq); |
194 | if (spu->irqs[i] == NO_IRQ) { | 197 | if (!spu->irqs[i]) { |
195 | pr_debug("spu_new: failed to map it !\n"); | 198 | pr_debug("spu_new: failed to map it !\n"); |
196 | goto err; | 199 | goto err; |
197 | } | 200 | } |
@@ -202,7 +205,7 @@ err: | |||
202 | pr_debug("failed to map irq %x for spu %s\n", *oirq.args, | 205 | pr_debug("failed to map irq %x for spu %s\n", *oirq.args, |
203 | spu->name); | 206 | spu->name); |
204 | for (; i >= 0; i--) { | 207 | for (; i >= 0; i--) { |
205 | if (spu->irqs[i] != NO_IRQ) | 208 | if (spu->irqs[i]) |
206 | irq_dispose_mapping(spu->irqs[i]); | 209 | irq_dispose_mapping(spu->irqs[i]); |
207 | } | 210 | } |
208 | return ret; | 211 | return ret; |
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c index bfb300633dfe..0ce1b45f02a8 100644 --- a/arch/powerpc/platforms/chrp/setup.c +++ b/arch/powerpc/platforms/chrp/setup.c | |||
@@ -368,7 +368,7 @@ static void chrp_8259_cascade(struct irq_desc *desc) | |||
368 | struct irq_chip *chip = irq_desc_get_chip(desc); | 368 | struct irq_chip *chip = irq_desc_get_chip(desc); |
369 | unsigned int cascade_irq = i8259_irq(); | 369 | unsigned int cascade_irq = i8259_irq(); |
370 | 370 | ||
371 | if (cascade_irq != NO_IRQ) | 371 | if (cascade_irq) |
372 | generic_handle_irq(cascade_irq); | 372 | generic_handle_irq(cascade_irq); |
373 | 373 | ||
374 | chip->irq_eoi(&desc->irq_data); | 374 | chip->irq_eoi(&desc->irq_data); |
@@ -514,7 +514,7 @@ static void __init chrp_find_8259(void) | |||
514 | } | 514 | } |
515 | if (chrp_mpic != NULL) { | 515 | if (chrp_mpic != NULL) { |
516 | cascade_irq = irq_of_parse_and_map(pic, 0); | 516 | cascade_irq = irq_of_parse_and_map(pic, 0); |
517 | if (cascade_irq == NO_IRQ) | 517 | if (!cascade_irq) |
518 | printk(KERN_ERR "i8259: failed to map cascade irq\n"); | 518 | printk(KERN_ERR "i8259: failed to map cascade irq\n"); |
519 | else | 519 | else |
520 | irq_set_chained_handler(cascade_irq, | 520 | irq_set_chained_handler(cascade_irq, |
diff --git a/arch/powerpc/platforms/embedded6xx/flipper-pic.c b/arch/powerpc/platforms/embedded6xx/flipper-pic.c index b7866e01483d..ade83829d5e8 100644 --- a/arch/powerpc/platforms/embedded6xx/flipper-pic.c +++ b/arch/powerpc/platforms/embedded6xx/flipper-pic.c | |||
@@ -181,7 +181,7 @@ unsigned int flipper_pic_get_irq(void) | |||
181 | irq_status = in_be32(io_base + FLIPPER_ICR) & | 181 | irq_status = in_be32(io_base + FLIPPER_ICR) & |
182 | in_be32(io_base + FLIPPER_IMR); | 182 | in_be32(io_base + FLIPPER_IMR); |
183 | if (irq_status == 0) | 183 | if (irq_status == 0) |
184 | return NO_IRQ; /* no more IRQs pending */ | 184 | return 0; /* no more IRQs pending */ |
185 | 185 | ||
186 | irq = __ffs(irq_status); | 186 | irq = __ffs(irq_status); |
187 | return irq_linear_revmap(flipper_irq_host, irq); | 187 | return irq_linear_revmap(flipper_irq_host, irq); |
diff --git a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c index 9b7975706bfc..89c54de88b7a 100644 --- a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c +++ b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c | |||
@@ -114,7 +114,7 @@ static unsigned int __hlwd_pic_get_irq(struct irq_domain *h) | |||
114 | irq_status = in_be32(io_base + HW_BROADWAY_ICR) & | 114 | irq_status = in_be32(io_base + HW_BROADWAY_ICR) & |
115 | in_be32(io_base + HW_BROADWAY_IMR); | 115 | in_be32(io_base + HW_BROADWAY_IMR); |
116 | if (irq_status == 0) | 116 | if (irq_status == 0) |
117 | return NO_IRQ; /* no more IRQs pending */ | 117 | return 0; /* no more IRQs pending */ |
118 | 118 | ||
119 | irq = __ffs(irq_status); | 119 | irq = __ffs(irq_status); |
120 | return irq_linear_revmap(h, irq); | 120 | return irq_linear_revmap(h, irq); |
@@ -131,7 +131,7 @@ static void hlwd_pic_irq_cascade(struct irq_desc *desc) | |||
131 | raw_spin_unlock(&desc->lock); | 131 | raw_spin_unlock(&desc->lock); |
132 | 132 | ||
133 | virq = __hlwd_pic_get_irq(irq_domain); | 133 | virq = __hlwd_pic_get_irq(irq_domain); |
134 | if (virq != NO_IRQ) | 134 | if (virq) |
135 | generic_handle_irq(virq); | 135 | generic_handle_irq(virq); |
136 | else | 136 | else |
137 | pr_err("spurious interrupt!\n"); | 137 | pr_err("spurious interrupt!\n"); |
diff --git a/arch/powerpc/platforms/embedded6xx/mvme5100.c b/arch/powerpc/platforms/embedded6xx/mvme5100.c index ed7321d6772e..8e3590941960 100644 --- a/arch/powerpc/platforms/embedded6xx/mvme5100.c +++ b/arch/powerpc/platforms/embedded6xx/mvme5100.c | |||
@@ -47,7 +47,7 @@ static void mvme5100_8259_cascade(struct irq_desc *desc) | |||
47 | struct irq_chip *chip = irq_desc_get_chip(desc); | 47 | struct irq_chip *chip = irq_desc_get_chip(desc); |
48 | unsigned int cascade_irq = i8259_irq(); | 48 | unsigned int cascade_irq = i8259_irq(); |
49 | 49 | ||
50 | if (cascade_irq != NO_IRQ) | 50 | if (cascade_irq) |
51 | generic_handle_irq(cascade_irq); | 51 | generic_handle_irq(cascade_irq); |
52 | 52 | ||
53 | chip->irq_eoi(&desc->irq_data); | 53 | chip->irq_eoi(&desc->irq_data); |
@@ -84,7 +84,7 @@ static void __init mvme5100_pic_init(void) | |||
84 | } | 84 | } |
85 | 85 | ||
86 | cirq = irq_of_parse_and_map(cp, 0); | 86 | cirq = irq_of_parse_and_map(cp, 0); |
87 | if (cirq == NO_IRQ) { | 87 | if (!cirq) { |
88 | pr_warn("mvme5100_pic_init: no cascade interrupt?\n"); | 88 | pr_warn("mvme5100_pic_init: no cascade interrupt?\n"); |
89 | return; | 89 | return; |
90 | } | 90 | } |
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c index a2f89e6326ce..a0589aac4163 100644 --- a/arch/powerpc/platforms/maple/pci.c +++ b/arch/powerpc/platforms/maple/pci.c | |||
@@ -552,7 +552,7 @@ void maple_pci_irq_fixup(struct pci_dev *dev) | |||
552 | pci_bus_to_host(dev->bus) == u4_pcie) { | 552 | pci_bus_to_host(dev->bus) == u4_pcie) { |
553 | printk(KERN_DEBUG "Fixup U4 PCIe IRQ\n"); | 553 | printk(KERN_DEBUG "Fixup U4 PCIe IRQ\n"); |
554 | dev->irq = irq_create_mapping(NULL, 1); | 554 | dev->irq = irq_create_mapping(NULL, 1); |
555 | if (dev->irq != NO_IRQ) | 555 | if (dev->irq) |
556 | irq_set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW); | 556 | irq_set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW); |
557 | } | 557 | } |
558 | 558 | ||
@@ -562,7 +562,7 @@ void maple_pci_irq_fixup(struct pci_dev *dev) | |||
562 | if (dev->vendor == PCI_VENDOR_ID_AMD && | 562 | if (dev->vendor == PCI_VENDOR_ID_AMD && |
563 | dev->device == PCI_DEVICE_ID_AMD_8111_IDE && | 563 | dev->device == PCI_DEVICE_ID_AMD_8111_IDE && |
564 | (dev->class & 5) != 5) { | 564 | (dev->class & 5) != 5) { |
565 | dev->irq = NO_IRQ; | 565 | dev->irq = 0; |
566 | } | 566 | } |
567 | 567 | ||
568 | DBG(" <- maple_pci_irq_fixup\n"); | 568 | DBG(" <- maple_pci_irq_fixup\n"); |
@@ -648,7 +648,7 @@ int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel) | |||
648 | return defirq; | 648 | return defirq; |
649 | } | 649 | } |
650 | irq = irq_of_parse_and_map(np, channel & 0x1); | 650 | irq = irq_of_parse_and_map(np, channel & 0x1); |
651 | if (irq == NO_IRQ) { | 651 | if (!irq) { |
652 | printk("Failed to map onboard IDE interrupt for channel %d\n", | 652 | printk("Failed to map onboard IDE interrupt for channel %d\n", |
653 | channel); | 653 | channel); |
654 | return defirq; | 654 | return defirq; |
diff --git a/arch/powerpc/platforms/pasemi/misc.c b/arch/powerpc/platforms/pasemi/misc.c index e0ab299763c1..8571e7bf78b6 100644 --- a/arch/powerpc/platforms/pasemi/misc.c +++ b/arch/powerpc/platforms/pasemi/misc.c | |||
@@ -76,7 +76,7 @@ static int __init pasemi_register_i2c_devices(void) | |||
76 | } | 76 | } |
77 | 77 | ||
78 | info.irq = irq_of_parse_and_map(node, 0); | 78 | info.irq = irq_of_parse_and_map(node, 0); |
79 | if (info.irq == NO_IRQ) | 79 | if (!info.irq) |
80 | info.irq = -1; | 80 | info.irq = -1; |
81 | 81 | ||
82 | if (find_i2c_driver(node, &info) < 0) | 82 | if (find_i2c_driver(node, &info) < 0) |
diff --git a/arch/powerpc/platforms/pasemi/msi.c b/arch/powerpc/platforms/pasemi/msi.c index d9af76342d99..d9cd510c8865 100644 --- a/arch/powerpc/platforms/pasemi/msi.c +++ b/arch/powerpc/platforms/pasemi/msi.c | |||
@@ -68,7 +68,7 @@ static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev) | |||
68 | pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev); | 68 | pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev); |
69 | 69 | ||
70 | for_each_pci_msi_entry(entry, pdev) { | 70 | for_each_pci_msi_entry(entry, pdev) { |
71 | if (entry->irq == NO_IRQ) | 71 | if (!entry->irq) |
72 | continue; | 72 | continue; |
73 | 73 | ||
74 | hwirq = virq_to_hw(entry->irq); | 74 | 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) | |||
109 | } | 109 | } |
110 | 110 | ||
111 | virq = irq_create_mapping(msi_mpic->irqhost, hwirq); | 111 | virq = irq_create_mapping(msi_mpic->irqhost, hwirq); |
112 | if (virq == NO_IRQ) { | 112 | if (!virq) { |
113 | pr_debug("pasemi_msi: failed mapping hwirq 0x%x\n", | 113 | pr_debug("pasemi_msi: failed mapping hwirq 0x%x\n", |
114 | hwirq); | 114 | hwirq); |
115 | msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, | 115 | msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, |
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index 1d0c3a621a38..3182400cf48f 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c | |||
@@ -59,7 +59,7 @@ struct mce_regs { | |||
59 | 59 | ||
60 | static struct mce_regs mce_regs[MAX_MCE_REGS]; | 60 | static struct mce_regs mce_regs[MAX_MCE_REGS]; |
61 | static int num_mce_regs; | 61 | static int num_mce_regs; |
62 | static int nmi_virq = NO_IRQ; | 62 | static int nmi_virq = 0; |
63 | 63 | ||
64 | 64 | ||
65 | static void __noreturn pas_restart(char *cmd) | 65 | static void __noreturn pas_restart(char *cmd) |
@@ -264,7 +264,7 @@ static int pas_machine_check_handler(struct pt_regs *regs) | |||
264 | srr0 = regs->nip; | 264 | srr0 = regs->nip; |
265 | srr1 = regs->msr; | 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 | printk(KERN_ERR "NMI delivered\n"); | 268 | printk(KERN_ERR "NMI delivered\n"); |
269 | debugger(regs); | 269 | debugger(regs); |
270 | mpic_end_irq(irq_get_irq_data(nmi_virq)); | 270 | mpic_end_irq(irq_get_irq_data(nmi_virq)); |
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c index 6d6f277477aa..c8c217b7dd33 100644 --- a/arch/powerpc/platforms/powermac/low_i2c.c +++ b/arch/powerpc/platforms/powermac/low_i2c.c | |||
@@ -401,7 +401,7 @@ static int kw_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, | |||
401 | { | 401 | { |
402 | struct pmac_i2c_host_kw *host = bus->hostdata; | 402 | struct pmac_i2c_host_kw *host = bus->hostdata; |
403 | u8 mode_reg = host->speed; | 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 | /* Setup mode & subaddress if any */ | 406 | /* Setup mode & subaddress if any */ |
407 | switch(bus->mode) { | 407 | switch(bus->mode) { |
@@ -535,7 +535,7 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) | |||
535 | break; | 535 | break; |
536 | } | 536 | } |
537 | host->irq = irq_of_parse_and_map(np, 0); | 537 | host->irq = irq_of_parse_and_map(np, 0); |
538 | if (host->irq == NO_IRQ) | 538 | if (!host->irq) |
539 | printk(KERN_WARNING | 539 | printk(KERN_WARNING |
540 | "low_i2c: Failed to map interrupt for %s\n", | 540 | "low_i2c: Failed to map interrupt for %s\n", |
541 | np->full_name); | 541 | np->full_name); |
@@ -557,7 +557,7 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) | |||
557 | */ | 557 | */ |
558 | if (request_irq(host->irq, kw_i2c_irq, IRQF_NO_SUSPEND, | 558 | if (request_irq(host->irq, kw_i2c_irq, IRQF_NO_SUSPEND, |
559 | "keywest i2c", host)) | 559 | "keywest i2c", host)) |
560 | host->irq = NO_IRQ; | 560 | host->irq = 0; |
561 | 561 | ||
562 | printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n", | 562 | printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n", |
563 | *addrp, host->irq, np->full_name); | 563 | *addrp, host->irq, np->full_name); |
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c index e49d07f3d542..459138ed4571 100644 --- a/arch/powerpc/platforms/powermac/pfunc_base.c +++ b/arch/powerpc/platforms/powermac/pfunc_base.c | |||
@@ -26,7 +26,7 @@ static irqreturn_t macio_gpio_irq(int irq, void *data) | |||
26 | static int macio_do_gpio_irq_enable(struct pmf_function *func) | 26 | static int macio_do_gpio_irq_enable(struct pmf_function *func) |
27 | { | 27 | { |
28 | unsigned int irq = irq_of_parse_and_map(func->node, 0); | 28 | unsigned int irq = irq_of_parse_and_map(func->node, 0); |
29 | if (irq == NO_IRQ) | 29 | if (!irq) |
30 | return -EINVAL; | 30 | return -EINVAL; |
31 | return request_irq(irq, macio_gpio_irq, 0, func->node->name, func); | 31 | return request_irq(irq, macio_gpio_irq, 0, func->node->name, func); |
32 | } | 32 | } |
@@ -34,7 +34,7 @@ static int macio_do_gpio_irq_enable(struct pmf_function *func) | |||
34 | static int macio_do_gpio_irq_disable(struct pmf_function *func) | 34 | static int macio_do_gpio_irq_disable(struct pmf_function *func) |
35 | { | 35 | { |
36 | unsigned int irq = irq_of_parse_and_map(func->node, 0); | 36 | unsigned int irq = irq_of_parse_and_map(func->node, 0); |
37 | if (irq == NO_IRQ) | 37 | if (!irq) |
38 | return -EINVAL; | 38 | return -EINVAL; |
39 | free_irq(irq, func); | 39 | free_irq(irq, func); |
40 | return 0; | 40 | return 0; |
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 981546345033..f5f9ad7c3398 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c | |||
@@ -251,7 +251,7 @@ static unsigned int pmac_pic_get_irq(void) | |||
251 | } | 251 | } |
252 | raw_spin_unlock_irqrestore(&pmac_pic_lock, flags); | 252 | raw_spin_unlock_irqrestore(&pmac_pic_lock, flags); |
253 | if (unlikely(irq < 0)) | 253 | if (unlikely(irq < 0)) |
254 | return NO_IRQ; | 254 | return 0; |
255 | return irq_linear_revmap(pmac_pic_host, irq); | 255 | return irq_linear_revmap(pmac_pic_host, irq); |
256 | } | 256 | } |
257 | 257 | ||
@@ -389,7 +389,7 @@ static void __init pmac_pic_probe_oldstyle(void) | |||
389 | out_le32(&pmac_irq_hw[i]->enable, 0); | 389 | out_le32(&pmac_irq_hw[i]->enable, 0); |
390 | 390 | ||
391 | /* Hookup cascade irq */ | 391 | /* Hookup cascade irq */ |
392 | if (slave && pmac_irq_cascade != NO_IRQ) | 392 | if (slave && pmac_irq_cascade) |
393 | setup_irq(pmac_irq_cascade, &gatwick_cascade_action); | 393 | setup_irq(pmac_irq_cascade, &gatwick_cascade_action); |
394 | 394 | ||
395 | printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs); | 395 | 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) | |||
444 | pswitch = of_find_node_by_name(NULL, "programmer-switch"); | 444 | pswitch = of_find_node_by_name(NULL, "programmer-switch"); |
445 | if (pswitch) { | 445 | if (pswitch) { |
446 | nmi_irq = irq_of_parse_and_map(pswitch, 0); | 446 | nmi_irq = irq_of_parse_and_map(pswitch, 0); |
447 | if (nmi_irq != NO_IRQ) { | 447 | if (nmi_irq) { |
448 | mpic_irq_set_priority(nmi_irq, 9); | 448 | mpic_irq_set_priority(nmi_irq, 9); |
449 | setup_irq(nmi_irq, &xmon_action); | 449 | setup_irq(nmi_irq, &xmon_action); |
450 | } | 450 | } |
diff --git a/arch/powerpc/platforms/powernv/opal-irqchip.c b/arch/powerpc/platforms/powernv/opal-irqchip.c index ed8bba68a162..998316bf2dad 100644 --- a/arch/powerpc/platforms/powernv/opal-irqchip.c +++ b/arch/powerpc/platforms/powernv/opal-irqchip.c | |||
@@ -222,7 +222,7 @@ int __init opal_event_init(void) | |||
222 | /* Get hardware and virtual IRQ */ | 222 | /* Get hardware and virtual IRQ */ |
223 | irq = be32_to_cpup(irqs); | 223 | irq = be32_to_cpup(irqs); |
224 | virq = irq_create_mapping(NULL, irq); | 224 | virq = irq_create_mapping(NULL, irq); |
225 | if (virq == NO_IRQ) { | 225 | if (!virq) { |
226 | pr_warn("Failed to map irq 0x%x\n", irq); | 226 | pr_warn("Failed to map irq 0x%x\n", irq); |
227 | continue; | 227 | continue; |
228 | } | 228 | } |
@@ -260,7 +260,7 @@ machine_arch_initcall(powernv, opal_event_init); | |||
260 | int opal_event_request(unsigned int opal_event_nr) | 260 | int opal_event_request(unsigned int opal_event_nr) |
261 | { | 261 | { |
262 | if (WARN_ON_ONCE(!opal_event_irqchip.domain)) | 262 | if (WARN_ON_ONCE(!opal_event_irqchip.domain)) |
263 | return NO_IRQ; | 263 | return 0; |
264 | 264 | ||
265 | return irq_create_mapping(opal_event_irqchip.domain, opal_event_nr); | 265 | return irq_create_mapping(opal_event_irqchip.domain, opal_event_nr); |
266 | } | 266 | } |
diff --git a/arch/powerpc/platforms/powernv/pci-cxl.c b/arch/powerpc/platforms/powernv/pci-cxl.c index 1349a099c74c..94498a04558b 100644 --- a/arch/powerpc/platforms/powernv/pci-cxl.c +++ b/arch/powerpc/platforms/powernv/pci-cxl.c | |||
@@ -344,7 +344,7 @@ int pnv_cxl_cx4_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
344 | return (hwirq ? hwirq : -ENOMEM); | 344 | return (hwirq ? hwirq : -ENOMEM); |
345 | 345 | ||
346 | virq = irq_create_mapping(NULL, hwirq); | 346 | virq = irq_create_mapping(NULL, hwirq); |
347 | if (virq == NO_IRQ) { | 347 | if (!virq) { |
348 | pr_warn("%s: Failed to map cxl mode MSI to linux irq\n", | 348 | pr_warn("%s: Failed to map cxl mode MSI to linux irq\n", |
349 | pci_name(pdev)); | 349 | pci_name(pdev)); |
350 | return -ENOMEM; | 350 | return -ENOMEM; |
@@ -374,7 +374,7 @@ void pnv_cxl_cx4_teardown_msi_irqs(struct pci_dev *pdev) | |||
374 | return; | 374 | return; |
375 | 375 | ||
376 | for_each_pci_msi_entry(entry, pdev) { | 376 | for_each_pci_msi_entry(entry, pdev) { |
377 | if (entry->irq == NO_IRQ) | 377 | if (!entry->irq) |
378 | continue; | 378 | continue; |
379 | hwirq = virq_to_hw(entry->irq); | 379 | hwirq = virq_to_hw(entry->irq); |
380 | irq_set_msi_desc(entry->irq, NULL); | 380 | irq_set_msi_desc(entry->irq, NULL); |
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index a21d831c1114..d6a4a61ede3d 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c | |||
@@ -186,7 +186,7 @@ int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
186 | return -ENOSPC; | 186 | return -ENOSPC; |
187 | } | 187 | } |
188 | virq = irq_create_mapping(NULL, phb->msi_base + hwirq); | 188 | virq = irq_create_mapping(NULL, phb->msi_base + hwirq); |
189 | if (virq == NO_IRQ) { | 189 | if (!virq) { |
190 | pr_warn("%s: Failed to map MSI to linux irq\n", | 190 | pr_warn("%s: Failed to map MSI to linux irq\n", |
191 | pci_name(pdev)); | 191 | pci_name(pdev)); |
192 | msi_bitmap_free_hwirqs(&phb->msi_bmp, hwirq, 1); | 192 | msi_bitmap_free_hwirqs(&phb->msi_bmp, hwirq, 1); |
@@ -217,7 +217,7 @@ void pnv_teardown_msi_irqs(struct pci_dev *pdev) | |||
217 | return; | 217 | return; |
218 | 218 | ||
219 | for_each_pci_msi_entry(entry, pdev) { | 219 | for_each_pci_msi_entry(entry, pdev) { |
220 | if (entry->irq == NO_IRQ) | 220 | if (!entry->irq) |
221 | continue; | 221 | continue; |
222 | hwirq = virq_to_hw(entry->irq); | 222 | hwirq = virq_to_hw(entry->irq); |
223 | irq_set_msi_desc(entry->irq, NULL); | 223 | irq_set_msi_desc(entry->irq, NULL); |
diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c index b831638e6f4a..98f8c3611133 100644 --- a/arch/powerpc/platforms/ps3/interrupt.c +++ b/arch/powerpc/platforms/ps3/interrupt.c | |||
@@ -192,7 +192,7 @@ static int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet, | |||
192 | 192 | ||
193 | *virq = irq_create_mapping(NULL, outlet); | 193 | *virq = irq_create_mapping(NULL, outlet); |
194 | 194 | ||
195 | if (*virq == NO_IRQ) { | 195 | if (!*virq) { |
196 | FAIL("%s:%d: irq_create_mapping failed: outlet %lu\n", | 196 | FAIL("%s:%d: irq_create_mapping failed: outlet %lu\n", |
197 | __func__, __LINE__, outlet); | 197 | __func__, __LINE__, outlet); |
198 | result = -ENOMEM; | 198 | result = -ENOMEM; |
@@ -339,7 +339,7 @@ int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq) | |||
339 | if (result) { | 339 | if (result) { |
340 | FAIL("%s:%d: lv1_construct_event_receive_port failed: %s\n", | 340 | FAIL("%s:%d: lv1_construct_event_receive_port failed: %s\n", |
341 | __func__, __LINE__, ps3_result(result)); | 341 | __func__, __LINE__, ps3_result(result)); |
342 | *virq = NO_IRQ; | 342 | *virq = 0; |
343 | return result; | 343 | return result; |
344 | } | 344 | } |
345 | 345 | ||
@@ -418,7 +418,7 @@ int ps3_sb_event_receive_port_setup(struct ps3_system_bus_device *dev, | |||
418 | " failed: %s\n", __func__, __LINE__, | 418 | " failed: %s\n", __func__, __LINE__, |
419 | ps3_result(result)); | 419 | ps3_result(result)); |
420 | ps3_event_receive_port_destroy(*virq); | 420 | ps3_event_receive_port_destroy(*virq); |
421 | *virq = NO_IRQ; | 421 | *virq = 0; |
422 | return result; | 422 | return result; |
423 | } | 423 | } |
424 | 424 | ||
@@ -724,12 +724,12 @@ static unsigned int ps3_get_irq(void) | |||
724 | asm volatile("cntlzd %0,%1" : "=r" (plug) : "r" (x)); | 724 | asm volatile("cntlzd %0,%1" : "=r" (plug) : "r" (x)); |
725 | plug &= 0x3f; | 725 | plug &= 0x3f; |
726 | 726 | ||
727 | if (unlikely(plug == NO_IRQ)) { | 727 | if (unlikely(!plug)) { |
728 | DBG("%s:%d: no plug found: thread_id %llu\n", __func__, | 728 | DBG("%s:%d: no plug found: thread_id %llu\n", __func__, |
729 | __LINE__, pd->thread_id); | 729 | __LINE__, pd->thread_id); |
730 | dump_bmp(&per_cpu(ps3_private, 0)); | 730 | dump_bmp(&per_cpu(ps3_private, 0)); |
731 | dump_bmp(&per_cpu(ps3_private, 1)); | 731 | dump_bmp(&per_cpu(ps3_private, 1)); |
732 | return NO_IRQ; | 732 | return 0; |
733 | } | 733 | } |
734 | 734 | ||
735 | #if defined(DEBUG) | 735 | #if defined(DEBUG) |
diff --git a/arch/powerpc/platforms/ps3/smp.c b/arch/powerpc/platforms/ps3/smp.c index 3c7707af3384..60154d08debf 100644 --- a/arch/powerpc/platforms/ps3/smp.c +++ b/arch/powerpc/platforms/ps3/smp.c | |||
@@ -91,7 +91,7 @@ static void __init ps3_smp_probe(void) | |||
91 | result = smp_request_message_ipi(virqs[i], i); | 91 | result = smp_request_message_ipi(virqs[i], i); |
92 | 92 | ||
93 | if (result) | 93 | if (result) |
94 | virqs[i] = NO_IRQ; | 94 | virqs[i] = 0; |
95 | else | 95 | else |
96 | ps3_register_ipi_irq(cpu, virqs[i]); | 96 | ps3_register_ipi_irq(cpu, virqs[i]); |
97 | } | 97 | } |
@@ -112,7 +112,7 @@ void ps3_smp_cleanup_cpu(int cpu) | |||
112 | for (i = 0; i < MSG_COUNT; i++) { | 112 | for (i = 0; i < MSG_COUNT; i++) { |
113 | /* Can't call free_irq from interrupt context. */ | 113 | /* Can't call free_irq from interrupt context. */ |
114 | ps3_event_receive_port_destroy(virqs[i]); | 114 | ps3_event_receive_port_destroy(virqs[i]); |
115 | virqs[i] = NO_IRQ; | 115 | virqs[i] = 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu); | 118 | DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu); |
diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c index 492b2575e0d2..b54850845466 100644 --- a/arch/powerpc/platforms/ps3/spu.c +++ b/arch/powerpc/platforms/ps3/spu.c | |||
@@ -284,7 +284,7 @@ fail_alloc_2: | |||
284 | fail_alloc_1: | 284 | fail_alloc_1: |
285 | ps3_spe_irq_destroy(spu->irqs[0]); | 285 | ps3_spe_irq_destroy(spu->irqs[0]); |
286 | fail_alloc_0: | 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 | return result; | 288 | return result; |
289 | } | 289 | } |
290 | 290 | ||
@@ -334,7 +334,7 @@ static int ps3_destroy_spu(struct spu *spu) | |||
334 | ps3_spe_irq_destroy(spu->irqs[1]); | 334 | ps3_spe_irq_destroy(spu->irqs[1]); |
335 | ps3_spe_irq_destroy(spu->irqs[0]); | 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 | spu_unmap(spu); | 339 | spu_unmap(spu); |
340 | 340 | ||
diff --git a/arch/powerpc/platforms/pseries/event_sources.c b/arch/powerpc/platforms/pseries/event_sources.c index a6ddca833119..32187dc76730 100644 --- a/arch/powerpc/platforms/pseries/event_sources.c +++ b/arch/powerpc/platforms/pseries/event_sources.c | |||
@@ -34,7 +34,7 @@ void request_event_sources_irqs(struct device_node *np, | |||
34 | if (count > 15) | 34 | if (count > 15) |
35 | break; | 35 | break; |
36 | virqs[count] = irq_create_of_mapping(&oirq); | 36 | virqs[count] = irq_create_of_mapping(&oirq); |
37 | if (virqs[count] == NO_IRQ) { | 37 | if (!virqs[count]) { |
38 | pr_err("event-sources: Unable to allocate " | 38 | pr_err("event-sources: Unable to allocate " |
39 | "interrupt number for %s\n", | 39 | "interrupt number for %s\n", |
40 | np->full_name); | 40 | np->full_name); |
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c index 543a6386f3eb..326ef0dd6038 100644 --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c | |||
@@ -119,7 +119,7 @@ static void rtas_teardown_msi_irqs(struct pci_dev *pdev) | |||
119 | struct msi_desc *entry; | 119 | struct msi_desc *entry; |
120 | 120 | ||
121 | for_each_pci_msi_entry(entry, pdev) { | 121 | for_each_pci_msi_entry(entry, pdev) { |
122 | if (entry->irq == NO_IRQ) | 122 | if (!entry->irq) |
123 | continue; | 123 | continue; |
124 | 124 | ||
125 | irq_set_msi_desc(entry->irq, NULL); | 125 | irq_set_msi_desc(entry->irq, NULL); |
@@ -471,7 +471,7 @@ again: | |||
471 | 471 | ||
472 | virq = irq_create_mapping(NULL, hwirq); | 472 | virq = irq_create_mapping(NULL, hwirq); |
473 | 473 | ||
474 | if (virq == NO_IRQ) { | 474 | if (!virq) { |
475 | pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq); | 475 | pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq); |
476 | return -ENOSPC; | 476 | return -ENOSPC; |
477 | } | 477 | } |
@@ -490,7 +490,7 @@ again: | |||
490 | static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev) | 490 | static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev) |
491 | { | 491 | { |
492 | /* No LSI -> leave MSIs (if any) configured */ | 492 | /* No LSI -> leave MSIs (if any) configured */ |
493 | if (pdev->irq == NO_IRQ) { | 493 | if (!pdev->irq) { |
494 | dev_dbg(&pdev->dev, "rtas_msi: no LSI, nothing to do.\n"); | 494 | dev_dbg(&pdev->dev, "rtas_msi: no LSI, nothing to do.\n"); |
495 | return; | 495 | return; |
496 | } | 496 | } |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 4ffcaa6f8670..776900043e2a 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -114,7 +114,7 @@ static void pseries_8259_cascade(struct irq_desc *desc) | |||
114 | struct irq_chip *chip = irq_desc_get_chip(desc); | 114 | struct irq_chip *chip = irq_desc_get_chip(desc); |
115 | unsigned int cascade_irq = i8259_irq(); | 115 | unsigned int cascade_irq = i8259_irq(); |
116 | 116 | ||
117 | if (cascade_irq != NO_IRQ) | 117 | if (cascade_irq) |
118 | generic_handle_irq(cascade_irq); | 118 | generic_handle_irq(cascade_irq); |
119 | 119 | ||
120 | chip->irq_eoi(&desc->irq_data); | 120 | chip->irq_eoi(&desc->irq_data); |
@@ -141,7 +141,7 @@ static void __init pseries_setup_i8259_cascade(void) | |||
141 | } | 141 | } |
142 | 142 | ||
143 | cascade = irq_of_parse_and_map(found, 0); | 143 | cascade = irq_of_parse_and_map(found, 0); |
144 | if (cascade == NO_IRQ) { | 144 | if (!cascade) { |
145 | printk(KERN_ERR "pic: failed to map cascade interrupt"); | 145 | printk(KERN_ERR "pic: failed to map cascade interrupt"); |
146 | return; | 146 | return; |
147 | } | 147 | } |
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c index 9144204442eb..ada29eaed6e2 100644 --- a/arch/powerpc/sysdev/axonram.c +++ b/arch/powerpc/sysdev/axonram.c | |||
@@ -240,7 +240,7 @@ static int axon_ram_probe(struct platform_device *device) | |||
240 | device_add_disk(&device->dev, bank->disk); | 240 | device_add_disk(&device->dev, bank->disk); |
241 | 241 | ||
242 | bank->irq_id = irq_of_parse_and_map(device->dev.of_node, 0); | 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 | dev_err(&device->dev, "Cannot access ECC interrupt ID\n"); | 244 | dev_err(&device->dev, "Cannot access ECC interrupt ID\n"); |
245 | rc = -EFAULT; | 245 | rc = -EFAULT; |
246 | goto failed; | 246 | goto failed; |
@@ -250,7 +250,7 @@ static int axon_ram_probe(struct platform_device *device) | |||
250 | AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device); | 250 | AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device); |
251 | if (rc != 0) { | 251 | if (rc != 0) { |
252 | dev_err(&device->dev, "Cannot register ECC interrupt handler\n"); | 252 | dev_err(&device->dev, "Cannot register ECC interrupt handler\n"); |
253 | bank->irq_id = NO_IRQ; | 253 | bank->irq_id = 0; |
254 | rc = -EFAULT; | 254 | rc = -EFAULT; |
255 | goto failed; | 255 | goto failed; |
256 | } | 256 | } |
@@ -268,7 +268,7 @@ static int axon_ram_probe(struct platform_device *device) | |||
268 | 268 | ||
269 | failed: | 269 | failed: |
270 | if (bank != NULL) { | 270 | if (bank != NULL) { |
271 | if (bank->irq_id != NO_IRQ) | 271 | if (bank->irq_id) |
272 | free_irq(bank->irq_id, device); | 272 | free_irq(bank->irq_id, device); |
273 | if (bank->disk != NULL) { | 273 | if (bank->disk != NULL) { |
274 | if (bank->disk->major > 0) | 274 | if (bank->disk->major > 0) |
diff --git a/arch/powerpc/sysdev/cpm1.c b/arch/powerpc/sysdev/cpm1.c index 81d49476c47e..3c0eb9b25535 100644 --- a/arch/powerpc/sysdev/cpm1.c +++ b/arch/powerpc/sysdev/cpm1.c | |||
@@ -132,7 +132,7 @@ unsigned int cpm_pic_init(void) | |||
132 | { | 132 | { |
133 | struct device_node *np = NULL; | 133 | struct device_node *np = NULL; |
134 | struct resource res; | 134 | struct resource res; |
135 | unsigned int sirq = NO_IRQ, hwirq, eirq; | 135 | unsigned int sirq = 0, hwirq, eirq; |
136 | int ret; | 136 | int ret; |
137 | 137 | ||
138 | pr_debug("cpm_pic_init\n"); | 138 | pr_debug("cpm_pic_init\n"); |
@@ -154,7 +154,7 @@ unsigned int cpm_pic_init(void) | |||
154 | goto end; | 154 | goto end; |
155 | 155 | ||
156 | sirq = irq_of_parse_and_map(np, 0); | 156 | sirq = irq_of_parse_and_map(np, 0); |
157 | if (sirq == NO_IRQ) | 157 | if (!sirq) |
158 | goto end; | 158 | goto end; |
159 | 159 | ||
160 | /* Initialize the CPM interrupt controller. */ | 160 | /* Initialize the CPM interrupt controller. */ |
@@ -168,7 +168,7 @@ unsigned int cpm_pic_init(void) | |||
168 | cpm_pic_host = irq_domain_add_linear(np, 64, &cpm_pic_host_ops, NULL); | 168 | cpm_pic_host = irq_domain_add_linear(np, 64, &cpm_pic_host_ops, NULL); |
169 | if (cpm_pic_host == NULL) { | 169 | if (cpm_pic_host == NULL) { |
170 | printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); | 170 | printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); |
171 | sirq = NO_IRQ; | 171 | sirq = 0; |
172 | goto end; | 172 | goto end; |
173 | } | 173 | } |
174 | 174 | ||
@@ -182,7 +182,7 @@ unsigned int cpm_pic_init(void) | |||
182 | } | 182 | } |
183 | 183 | ||
184 | eirq = irq_of_parse_and_map(np, 0); | 184 | eirq = irq_of_parse_and_map(np, 0); |
185 | if (eirq == NO_IRQ) | 185 | if (!eirq) |
186 | goto end; | 186 | goto end; |
187 | 187 | ||
188 | if (setup_irq(eirq, &cpm_error_irqaction)) | 188 | if (setup_irq(eirq, &cpm_error_irqaction)) |
diff --git a/arch/powerpc/sysdev/ehv_pic.c b/arch/powerpc/sysdev/ehv_pic.c index bffcc7a486a1..48866e6c1efb 100644 --- a/arch/powerpc/sysdev/ehv_pic.c +++ b/arch/powerpc/sysdev/ehv_pic.c | |||
@@ -155,7 +155,7 @@ static struct irq_chip ehv_pic_direct_eoi_irq_chip = { | |||
155 | .irq_set_type = ehv_pic_set_irq_type, | 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 | unsigned int ehv_pic_get_irq(void) | 159 | unsigned int ehv_pic_get_irq(void) |
160 | { | 160 | { |
161 | int irq; | 161 | int irq; |
@@ -168,7 +168,7 @@ unsigned int ehv_pic_get_irq(void) | |||
168 | ev_int_iack(0, &irq); /* legacy mode */ | 168 | ev_int_iack(0, &irq); /* legacy mode */ |
169 | 169 | ||
170 | if (irq == 0xFFFF) /* 0xFFFF --> no irq is pending */ | 170 | if (irq == 0xFFFF) /* 0xFFFF --> no irq is pending */ |
171 | return NO_IRQ; | 171 | return 0; |
172 | 172 | ||
173 | /* | 173 | /* |
174 | * this will also setup revmap[] in the slow path for the first | 174 | * this will also setup revmap[] in the slow path for the first |
diff --git a/arch/powerpc/sysdev/fsl_gtm.c b/arch/powerpc/sysdev/fsl_gtm.c index 06ac3c61b3d0..a6f0b96ce2c9 100644 --- a/arch/powerpc/sysdev/fsl_gtm.c +++ b/arch/powerpc/sysdev/fsl_gtm.c | |||
@@ -406,7 +406,7 @@ static int __init fsl_gtm_init(void) | |||
406 | unsigned int irq; | 406 | unsigned int irq; |
407 | 407 | ||
408 | irq = irq_of_parse_and_map(np, i); | 408 | irq = irq_of_parse_and_map(np, i); |
409 | if (irq == NO_IRQ) { | 409 | if (!irq) { |
410 | pr_err("%s: not enough interrupts specified\n", | 410 | pr_err("%s: not enough interrupts specified\n", |
411 | np->full_name); | 411 | np->full_name); |
412 | goto err; | 412 | goto err; |
diff --git a/arch/powerpc/sysdev/fsl_mpic_err.c b/arch/powerpc/sysdev/fsl_mpic_err.c index b83f32562a37..488ec453038a 100644 --- a/arch/powerpc/sysdev/fsl_mpic_err.c +++ b/arch/powerpc/sysdev/fsl_mpic_err.c | |||
@@ -115,8 +115,8 @@ static irqreturn_t fsl_error_int_handler(int irq, void *data) | |||
115 | errint = __builtin_clz(eisr); | 115 | errint = __builtin_clz(eisr); |
116 | cascade_irq = irq_linear_revmap(mpic->irqhost, | 116 | cascade_irq = irq_linear_revmap(mpic->irqhost, |
117 | mpic->err_int_vecs[errint]); | 117 | mpic->err_int_vecs[errint]); |
118 | WARN_ON(cascade_irq == NO_IRQ); | 118 | WARN_ON(!cascade_irq); |
119 | if (cascade_irq != NO_IRQ) { | 119 | if (cascade_irq) { |
120 | generic_handle_irq(cascade_irq); | 120 | generic_handle_irq(cascade_irq); |
121 | } else { | 121 | } else { |
122 | eimr |= 1 << (31 - errint); | 122 | eimr |= 1 << (31 - errint); |
@@ -134,7 +134,7 @@ void mpic_err_int_init(struct mpic *mpic, irq_hw_number_t irqnum) | |||
134 | int ret; | 134 | int ret; |
135 | 135 | ||
136 | virq = irq_create_mapping(mpic->irqhost, irqnum); | 136 | virq = irq_create_mapping(mpic->irqhost, irqnum); |
137 | if (virq == NO_IRQ) { | 137 | if (!virq) { |
138 | pr_err("Error interrupt setup failed\n"); | 138 | pr_err("Error interrupt setup failed\n"); |
139 | return; | 139 | return; |
140 | } | 140 | } |
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index 3a2be3676f43..8a244828782e 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c | |||
@@ -131,7 +131,7 @@ static void fsl_teardown_msi_irqs(struct pci_dev *pdev) | |||
131 | irq_hw_number_t hwirq; | 131 | irq_hw_number_t hwirq; |
132 | 132 | ||
133 | for_each_pci_msi_entry(entry, pdev) { | 133 | for_each_pci_msi_entry(entry, pdev) { |
134 | if (entry->irq == NO_IRQ) | 134 | if (!entry->irq) |
135 | continue; | 135 | continue; |
136 | hwirq = virq_to_hw(entry->irq); | 136 | hwirq = virq_to_hw(entry->irq); |
137 | msi_data = irq_get_chip_data(entry->irq); | 137 | 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) | |||
250 | 250 | ||
251 | virq = irq_create_mapping(msi_data->irqhost, hwirq); | 251 | virq = irq_create_mapping(msi_data->irqhost, hwirq); |
252 | 252 | ||
253 | if (virq == NO_IRQ) { | 253 | if (!virq) { |
254 | dev_err(&pdev->dev, "fail mapping hwirq %i\n", hwirq); | 254 | dev_err(&pdev->dev, "fail mapping hwirq %i\n", hwirq); |
255 | msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1); | 255 | msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1); |
256 | rc = -ENOSPC; | 256 | rc = -ENOSPC; |
@@ -285,7 +285,7 @@ static irqreturn_t fsl_msi_cascade(int irq, void *data) | |||
285 | msir_index = cascade_data->index; | 285 | msir_index = cascade_data->index; |
286 | 286 | ||
287 | if (msir_index >= NR_MSI_REG_MAX) | 287 | if (msir_index >= NR_MSI_REG_MAX) |
288 | cascade_irq = NO_IRQ; | 288 | cascade_irq = 0; |
289 | 289 | ||
290 | switch (msi_data->feature & FSL_PIC_IP_MASK) { | 290 | switch (msi_data->feature & FSL_PIC_IP_MASK) { |
291 | case FSL_PIC_IP_MPIC: | 291 | case FSL_PIC_IP_MPIC: |
@@ -315,7 +315,7 @@ static irqreturn_t fsl_msi_cascade(int irq, void *data) | |||
315 | cascade_irq = irq_linear_revmap(msi_data->irqhost, | 315 | cascade_irq = irq_linear_revmap(msi_data->irqhost, |
316 | msi_hwirq(msi_data, msir_index, | 316 | msi_hwirq(msi_data, msir_index, |
317 | intr_index + have_shift)); | 317 | intr_index + have_shift)); |
318 | if (cascade_irq != NO_IRQ) { | 318 | if (cascade_irq) { |
319 | generic_handle_irq(cascade_irq); | 319 | generic_handle_irq(cascade_irq); |
320 | ret = IRQ_HANDLED; | 320 | ret = IRQ_HANDLED; |
321 | } | 321 | } |
@@ -337,7 +337,7 @@ static int fsl_of_msi_remove(struct platform_device *ofdev) | |||
337 | if (msi->cascade_array[i]) { | 337 | if (msi->cascade_array[i]) { |
338 | virq = msi->cascade_array[i]->virq; | 338 | virq = msi->cascade_array[i]->virq; |
339 | 339 | ||
340 | BUG_ON(virq == NO_IRQ); | 340 | BUG_ON(!virq); |
341 | 341 | ||
342 | free_irq(virq, msi->cascade_array[i]); | 342 | free_irq(virq, msi->cascade_array[i]); |
343 | kfree(msi->cascade_array[i]); | 343 | kfree(msi->cascade_array[i]); |
@@ -362,7 +362,7 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct platform_device *dev, | |||
362 | int virt_msir, i, ret; | 362 | int virt_msir, i, ret; |
363 | 363 | ||
364 | virt_msir = irq_of_parse_and_map(dev->dev.of_node, irq_index); | 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 | dev_err(&dev->dev, "%s: Cannot translate IRQ index %d\n", | 366 | dev_err(&dev->dev, "%s: Cannot translate IRQ index %d\n", |
367 | __func__, irq_index); | 367 | __func__, irq_index); |
368 | return 0; | 368 | return 0; |
diff --git a/arch/powerpc/sysdev/ge/ge_pic.c b/arch/powerpc/sysdev/ge/ge_pic.c index d57b77573068..02553a8ce191 100644 --- a/arch/powerpc/sysdev/ge/ge_pic.c +++ b/arch/powerpc/sysdev/ge/ge_pic.c | |||
@@ -102,7 +102,7 @@ static void gef_pic_cascade(struct irq_desc *desc) | |||
102 | */ | 102 | */ |
103 | cascade_irq = gef_pic_get_irq(); | 103 | cascade_irq = gef_pic_get_irq(); |
104 | 104 | ||
105 | if (cascade_irq != NO_IRQ) | 105 | if (cascade_irq) |
106 | generic_handle_irq(cascade_irq); | 106 | generic_handle_irq(cascade_irq); |
107 | 107 | ||
108 | chip->irq_eoi(&desc->irq_data); | 108 | chip->irq_eoi(&desc->irq_data); |
@@ -206,7 +206,7 @@ void __init gef_pic_init(struct device_node *np) | |||
206 | 206 | ||
207 | /* Map controller */ | 207 | /* Map controller */ |
208 | gef_pic_cascade_irq = irq_of_parse_and_map(np, 0); | 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 | printk(KERN_ERR "SBC610: failed to map cascade interrupt"); | 210 | printk(KERN_ERR "SBC610: failed to map cascade interrupt"); |
211 | return; | 211 | return; |
212 | } | 212 | } |
@@ -223,12 +223,12 @@ void __init gef_pic_init(struct device_node *np) | |||
223 | 223 | ||
224 | /* | 224 | /* |
225 | * This is called when we receive an interrupt with apparently comes from this | 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 | unsigned int gef_pic_get_irq(void) | 228 | unsigned int gef_pic_get_irq(void) |
229 | { | 229 | { |
230 | u32 cause, mask, active; | 230 | u32 cause, mask, active; |
231 | unsigned int virq = NO_IRQ; | 231 | unsigned int virq = 0; |
232 | int hwirq; | 232 | int hwirq; |
233 | 233 | ||
234 | cause = in_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_STATUS); | 234 | cause = in_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_STATUS); |
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c index aa2c186d3115..bafb014e1a7e 100644 --- a/arch/powerpc/sysdev/i8259.c +++ b/arch/powerpc/sysdev/i8259.c | |||
@@ -68,9 +68,9 @@ unsigned int i8259_irq(void) | |||
68 | if (!pci_intack) | 68 | if (!pci_intack) |
69 | outb(0x0B, 0x20); /* ISR register */ | 69 | outb(0x0B, 0x20); /* ISR register */ |
70 | if(~inb(0x20) & 0x80) | 70 | if(~inb(0x20) & 0x80) |
71 | irq = NO_IRQ; | 71 | irq = 0; |
72 | } else if (irq == 0xff) | 72 | } else if (irq == 0xff) |
73 | irq = NO_IRQ; | 73 | irq = 0; |
74 | 74 | ||
75 | if (lock) | 75 | if (lock) |
76 | raw_spin_unlock(&i8259_lock); | 76 | raw_spin_unlock(&i8259_lock); |
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index f76ee39cb337..f267ee0afc08 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c | |||
@@ -853,7 +853,7 @@ void ipic_clear_mcp_status(u32 mask) | |||
853 | ipic_write(primary_ipic->regs, IPIC_SERMR, mask); | 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 | unsigned int ipic_get_irq(void) | 857 | unsigned int ipic_get_irq(void) |
858 | { | 858 | { |
859 | int irq; | 859 | int irq; |
@@ -864,7 +864,7 @@ unsigned int ipic_get_irq(void) | |||
864 | irq = ipic_read(primary_ipic->regs, IPIC_SIVCR) & IPIC_SIVCR_VECTOR_MASK; | 864 | irq = ipic_read(primary_ipic->regs, IPIC_SIVCR) & IPIC_SIVCR_VECTOR_MASK; |
865 | 865 | ||
866 | if (irq == 0) /* 0 --> no irq is pending */ | 866 | if (irq == 0) /* 0 --> no irq is pending */ |
867 | return NO_IRQ; | 867 | return 0; |
868 | 868 | ||
869 | return irq_linear_revmap(primary_ipic->irqhost, irq); | 869 | return irq_linear_revmap(primary_ipic->irqhost, irq); |
870 | } | 870 | } |
diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c index b7cf7abff2eb..3e828b20c21e 100644 --- a/arch/powerpc/sysdev/mpc8xx_pic.c +++ b/arch/powerpc/sysdev/mpc8xx_pic.c | |||
@@ -79,7 +79,7 @@ unsigned int mpc8xx_get_irq(void) | |||
79 | irq = in_be32(&siu_reg->sc_sivec) >> 26; | 79 | irq = in_be32(&siu_reg->sc_sivec) >> 26; |
80 | 80 | ||
81 | if (irq == PIC_VEC_SPURRIOUS) | 81 | if (irq == PIC_VEC_SPURRIOUS) |
82 | irq = NO_IRQ; | 82 | irq = 0; |
83 | 83 | ||
84 | return irq_linear_revmap(mpc8xx_pic_host, irq); | 84 | return irq_linear_revmap(mpc8xx_pic_host, irq); |
85 | 85 | ||
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 7de45b2df366..4d48cecfedd1 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -1649,7 +1649,7 @@ void __init mpic_init(struct mpic *mpic) | |||
1649 | /* Check if this MPIC is chained from a parent interrupt controller */ | 1649 | /* Check if this MPIC is chained from a parent interrupt controller */ |
1650 | if (mpic->flags & MPIC_SECONDARY) { | 1650 | if (mpic->flags & MPIC_SECONDARY) { |
1651 | int virq = irq_of_parse_and_map(mpic->node, 0); | 1651 | int virq = irq_of_parse_and_map(mpic->node, 0); |
1652 | if (virq != NO_IRQ) { | 1652 | if (virq) { |
1653 | printk(KERN_INFO "%s: hooking up to IRQ %d\n", | 1653 | printk(KERN_INFO "%s: hooking up to IRQ %d\n", |
1654 | mpic->node->full_name, virq); | 1654 | mpic->node->full_name, virq); |
1655 | irq_set_handler_data(virq, mpic); | 1655 | irq_set_handler_data(virq, mpic); |
@@ -1778,13 +1778,13 @@ static unsigned int _mpic_get_one_irq(struct mpic *mpic, int reg) | |||
1778 | if (unlikely(src == mpic->spurious_vec)) { | 1778 | if (unlikely(src == mpic->spurious_vec)) { |
1779 | if (mpic->flags & MPIC_SPV_EOI) | 1779 | if (mpic->flags & MPIC_SPV_EOI) |
1780 | mpic_eoi(mpic); | 1780 | mpic_eoi(mpic); |
1781 | return NO_IRQ; | 1781 | return 0; |
1782 | } | 1782 | } |
1783 | if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { | 1783 | if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { |
1784 | printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n", | 1784 | printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n", |
1785 | mpic->name, (int)src); | 1785 | mpic->name, (int)src); |
1786 | mpic_eoi(mpic); | 1786 | mpic_eoi(mpic); |
1787 | return NO_IRQ; | 1787 | return 0; |
1788 | } | 1788 | } |
1789 | 1789 | ||
1790 | return irq_linear_revmap(mpic->irqhost, src); | 1790 | return irq_linear_revmap(mpic->irqhost, src); |
@@ -1817,17 +1817,17 @@ unsigned int mpic_get_coreint_irq(void) | |||
1817 | if (unlikely(src == mpic->spurious_vec)) { | 1817 | if (unlikely(src == mpic->spurious_vec)) { |
1818 | if (mpic->flags & MPIC_SPV_EOI) | 1818 | if (mpic->flags & MPIC_SPV_EOI) |
1819 | mpic_eoi(mpic); | 1819 | mpic_eoi(mpic); |
1820 | return NO_IRQ; | 1820 | return 0; |
1821 | } | 1821 | } |
1822 | if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { | 1822 | if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { |
1823 | printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n", | 1823 | printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n", |
1824 | mpic->name, (int)src); | 1824 | mpic->name, (int)src); |
1825 | return NO_IRQ; | 1825 | return 0; |
1826 | } | 1826 | } |
1827 | 1827 | ||
1828 | return irq_linear_revmap(mpic->irqhost, src); | 1828 | return irq_linear_revmap(mpic->irqhost, src); |
1829 | #else | 1829 | #else |
1830 | return NO_IRQ; | 1830 | return 0; |
1831 | #endif | 1831 | #endif |
1832 | } | 1832 | } |
1833 | 1833 | ||
@@ -1852,7 +1852,7 @@ void mpic_request_ipis(void) | |||
1852 | for (i = 0; i < 4; i++) { | 1852 | for (i = 0; i < 4; i++) { |
1853 | unsigned int vipi = irq_create_mapping(mpic->irqhost, | 1853 | unsigned int vipi = irq_create_mapping(mpic->irqhost, |
1854 | mpic->ipi_vecs[0] + i); | 1854 | mpic->ipi_vecs[0] + i); |
1855 | if (vipi == NO_IRQ) { | 1855 | if (!vipi) { |
1856 | printk(KERN_ERR "Failed to map %s\n", smp_ipi_name[i]); | 1856 | printk(KERN_ERR "Failed to map %s\n", smp_ipi_name[i]); |
1857 | continue; | 1857 | continue; |
1858 | } | 1858 | } |
diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c index 3f165d972a0e..db2286be5d9a 100644 --- a/arch/powerpc/sysdev/mpic_msgr.c +++ b/arch/powerpc/sysdev/mpic_msgr.c | |||
@@ -238,7 +238,7 @@ static int mpic_msgr_probe(struct platform_device *dev) | |||
238 | 238 | ||
239 | if (receive_mask & (1 << i)) { | 239 | if (receive_mask & (1 << i)) { |
240 | msgr->irq = irq_of_parse_and_map(np, irq_index); | 240 | msgr->irq = irq_of_parse_and_map(np, irq_index); |
241 | if (msgr->irq == NO_IRQ) { | 241 | if (!msgr->irq) { |
242 | dev_err(&dev->dev, | 242 | dev_err(&dev->dev, |
243 | "Missing interrupt specifier"); | 243 | "Missing interrupt specifier"); |
244 | kfree(msgr); | 244 | kfree(msgr); |
@@ -246,7 +246,7 @@ static int mpic_msgr_probe(struct platform_device *dev) | |||
246 | } | 246 | } |
247 | irq_index += 1; | 247 | irq_index += 1; |
248 | } else { | 248 | } else { |
249 | msgr->irq = NO_IRQ; | 249 | msgr->irq = 0; |
250 | } | 250 | } |
251 | 251 | ||
252 | mpic_msgrs[reg_number] = msgr; | 252 | mpic_msgrs[reg_number] = msgr; |
diff --git a/arch/powerpc/sysdev/mpic_u3msi.c b/arch/powerpc/sysdev/mpic_u3msi.c index 2cbc7e29b85f..cfc1c57d760f 100644 --- a/arch/powerpc/sysdev/mpic_u3msi.c +++ b/arch/powerpc/sysdev/mpic_u3msi.c | |||
@@ -110,7 +110,7 @@ static void u3msi_teardown_msi_irqs(struct pci_dev *pdev) | |||
110 | irq_hw_number_t hwirq; | 110 | irq_hw_number_t hwirq; |
111 | 111 | ||
112 | for_each_pci_msi_entry(entry, pdev) { | 112 | for_each_pci_msi_entry(entry, pdev) { |
113 | if (entry->irq == NO_IRQ) | 113 | if (!entry->irq) |
114 | continue; | 114 | continue; |
115 | 115 | ||
116 | hwirq = virq_to_hw(entry->irq); | 116 | hwirq = virq_to_hw(entry->irq); |
@@ -155,7 +155,7 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
155 | msg.address_hi = addr >> 32; | 155 | msg.address_hi = addr >> 32; |
156 | 156 | ||
157 | virq = irq_create_mapping(msi_mpic->irqhost, hwirq); | 157 | virq = irq_create_mapping(msi_mpic->irqhost, hwirq); |
158 | if (virq == NO_IRQ) { | 158 | if (!virq) { |
159 | pr_debug("u3msi: failed mapping hwirq 0x%x\n", hwirq); | 159 | pr_debug("u3msi: failed mapping hwirq 0x%x\n", hwirq); |
160 | msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1); | 160 | msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1); |
161 | return -ENOSPC; | 161 | return -ENOSPC; |
diff --git a/arch/powerpc/sysdev/mv64x60_pic.c b/arch/powerpc/sysdev/mv64x60_pic.c index 0f842dd16bcd..a79953deb489 100644 --- a/arch/powerpc/sysdev/mv64x60_pic.c +++ b/arch/powerpc/sysdev/mv64x60_pic.c | |||
@@ -272,7 +272,7 @@ unsigned int mv64x60_get_irq(void) | |||
272 | u32 cause; | 272 | u32 cause; |
273 | int level1; | 273 | int level1; |
274 | irq_hw_number_t hwirq; | 274 | irq_hw_number_t hwirq; |
275 | int virq = NO_IRQ; | 275 | int virq = 0; |
276 | 276 | ||
277 | cause = in_le32(mv64x60_irq_reg_base + MV64X60_IC_CPU0_SELECT_CAUSE); | 277 | cause = in_le32(mv64x60_irq_reg_base + MV64X60_IC_CPU0_SELECT_CAUSE); |
278 | if (cause & MV64X60_SELECT_CAUSE_HIGH) { | 278 | if (cause & MV64X60_SELECT_CAUSE_HIGH) { |
diff --git a/arch/powerpc/sysdev/pmi.c b/arch/powerpc/sysdev/pmi.c index 8a0b77a3ec0c..9ea6a221d9d5 100644 --- a/arch/powerpc/sysdev/pmi.c +++ b/arch/powerpc/sysdev/pmi.c | |||
@@ -158,7 +158,7 @@ static int pmi_of_probe(struct platform_device *dev) | |||
158 | data->dev = dev; | 158 | data->dev = dev; |
159 | 159 | ||
160 | data->irq = irq_of_parse_and_map(np, 0); | 160 | data->irq = irq_of_parse_and_map(np, 0); |
161 | if (data->irq == NO_IRQ) { | 161 | if (!data->irq) { |
162 | printk(KERN_ERR "pmi: invalid interrupt.\n"); | 162 | printk(KERN_ERR "pmi: invalid interrupt.\n"); |
163 | rc = -EFAULT; | 163 | rc = -EFAULT; |
164 | goto error_cleanup_iomap; | 164 | goto error_cleanup_iomap; |
diff --git a/arch/powerpc/sysdev/ppc4xx_hsta_msi.c b/arch/powerpc/sysdev/ppc4xx_hsta_msi.c index 52a93dcae262..9926ad67af76 100644 --- a/arch/powerpc/sysdev/ppc4xx_hsta_msi.c +++ b/arch/powerpc/sysdev/ppc4xx_hsta_msi.c | |||
@@ -60,7 +60,7 @@ static int hsta_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
60 | } | 60 | } |
61 | 61 | ||
62 | hwirq = ppc4xx_hsta_msi.irq_map[irq]; | 62 | hwirq = ppc4xx_hsta_msi.irq_map[irq]; |
63 | if (hwirq == NO_IRQ) { | 63 | if (!hwirq) { |
64 | pr_err("%s: Failed mapping irq %d\n", __func__, irq); | 64 | pr_err("%s: Failed mapping irq %d\n", __func__, irq); |
65 | return -EINVAL; | 65 | return -EINVAL; |
66 | } | 66 | } |
@@ -110,7 +110,7 @@ static void hsta_teardown_msi_irqs(struct pci_dev *dev) | |||
110 | int irq; | 110 | int irq; |
111 | 111 | ||
112 | for_each_pci_msi_entry(entry, dev) { | 112 | for_each_pci_msi_entry(entry, dev) { |
113 | if (entry->irq == NO_IRQ) | 113 | if (!entry->irq) |
114 | continue; | 114 | continue; |
115 | 115 | ||
116 | irq = hsta_find_hwirq_offset(entry->irq); | 116 | irq = hsta_find_hwirq_offset(entry->irq); |
@@ -166,7 +166,7 @@ static int hsta_msi_probe(struct platform_device *pdev) | |||
166 | for (irq = 0; irq < irq_count; irq++) { | 166 | for (irq = 0; irq < irq_count; irq++) { |
167 | ppc4xx_hsta_msi.irq_map[irq] = | 167 | ppc4xx_hsta_msi.irq_map[irq] = |
168 | irq_of_parse_and_map(dev->of_node, irq); | 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 | dev_err(dev, "Unable to map IRQ\n"); | 170 | dev_err(dev, "Unable to map IRQ\n"); |
171 | ret = -EINVAL; | 171 | ret = -EINVAL; |
172 | goto out2; | 172 | goto out2; |
diff --git a/arch/powerpc/sysdev/ppc4xx_msi.c b/arch/powerpc/sysdev/ppc4xx_msi.c index 8fb806135043..590dab4f47d6 100644 --- a/arch/powerpc/sysdev/ppc4xx_msi.c +++ b/arch/powerpc/sysdev/ppc4xx_msi.c | |||
@@ -102,7 +102,7 @@ static int ppc4xx_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
102 | __func__); | 102 | __func__); |
103 | } | 103 | } |
104 | virq = irq_of_parse_and_map(msi_data->msi_dev, int_no); | 104 | virq = irq_of_parse_and_map(msi_data->msi_dev, int_no); |
105 | if (virq == NO_IRQ) { | 105 | if (!virq) { |
106 | dev_err(&dev->dev, "%s: fail mapping irq\n", __func__); | 106 | dev_err(&dev->dev, "%s: fail mapping irq\n", __func__); |
107 | msi_bitmap_free_hwirqs(&msi_data->bitmap, int_no, 1); | 107 | msi_bitmap_free_hwirqs(&msi_data->bitmap, int_no, 1); |
108 | return -ENOSPC; | 108 | return -ENOSPC; |
@@ -129,7 +129,7 @@ void ppc4xx_teardown_msi_irqs(struct pci_dev *dev) | |||
129 | dev_dbg(&dev->dev, "PCIE-MSI: tearing down msi irqs\n"); | 129 | dev_dbg(&dev->dev, "PCIE-MSI: tearing down msi irqs\n"); |
130 | 130 | ||
131 | for_each_pci_msi_entry(entry, dev) { | 131 | for_each_pci_msi_entry(entry, dev) { |
132 | if (entry->irq == NO_IRQ) | 132 | if (!entry->irq) |
133 | continue; | 133 | continue; |
134 | hwirq = virq_to_hw(entry->irq); | 134 | hwirq = virq_to_hw(entry->irq); |
135 | irq_set_msi_desc(entry->irq, NULL); | 135 | irq_set_msi_desc(entry->irq, NULL); |
@@ -201,7 +201,7 @@ static int ppc4xx_of_msi_remove(struct platform_device *dev) | |||
201 | 201 | ||
202 | for (i = 0; i < msi_irqs; i++) { | 202 | for (i = 0; i < msi_irqs; i++) { |
203 | virq = msi->msi_virqs[i]; | 203 | virq = msi->msi_virqs[i]; |
204 | if (virq != NO_IRQ) | 204 | if (virq) |
205 | irq_dispose_mapping(virq); | 205 | irq_dispose_mapping(virq); |
206 | } | 206 | } |
207 | 207 | ||
diff --git a/arch/powerpc/sysdev/ppc4xx_soc.c b/arch/powerpc/sysdev/ppc4xx_soc.c index 5c77c9ba33aa..d41134d2f786 100644 --- a/arch/powerpc/sysdev/ppc4xx_soc.c +++ b/arch/powerpc/sysdev/ppc4xx_soc.c | |||
@@ -109,7 +109,7 @@ static int __init ppc4xx_l2c_probe(void) | |||
109 | 109 | ||
110 | /* Get and map irq number from device tree */ | 110 | /* Get and map irq number from device tree */ |
111 | irq = irq_of_parse_and_map(np, 0); | 111 | irq = irq_of_parse_and_map(np, 0); |
112 | if (irq == NO_IRQ) { | 112 | if (!irq) { |
113 | printk(KERN_ERR "irq_of_parse_and_map failed\n"); | 113 | printk(KERN_ERR "irq_of_parse_and_map failed\n"); |
114 | of_node_put(np); | 114 | of_node_put(np); |
115 | return -ENODEV; | 115 | return -ENODEV; |
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c index 379de955aae3..57c971b7839c 100644 --- a/arch/powerpc/sysdev/tsi108_pci.c +++ b/arch/powerpc/sysdev/tsi108_pci.c | |||
@@ -433,7 +433,7 @@ void tsi108_irq_cascade(struct irq_desc *desc) | |||
433 | struct irq_chip *chip = irq_desc_get_chip(desc); | 433 | struct irq_chip *chip = irq_desc_get_chip(desc); |
434 | unsigned int cascade_irq = get_pci_source(); | 434 | unsigned int cascade_irq = get_pci_source(); |
435 | 435 | ||
436 | if (cascade_irq != NO_IRQ) | 436 | if (cascade_irq) |
437 | generic_handle_irq(cascade_irq); | 437 | generic_handle_irq(cascade_irq); |
438 | 438 | ||
439 | chip->irq_eoi(&desc->irq_data); | 439 | chip->irq_eoi(&desc->irq_data); |
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c index 6893d8f236df..a00949f3e378 100644 --- a/arch/powerpc/sysdev/uic.c +++ b/arch/powerpc/sysdev/uic.c | |||
@@ -319,7 +319,7 @@ void __init uic_init_tree(void) | |||
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 | unsigned int uic_get_irq(void) | 323 | unsigned int uic_get_irq(void) |
324 | { | 324 | { |
325 | u32 msr; | 325 | u32 msr; |
diff --git a/arch/powerpc/sysdev/xics/icp-hv.c b/arch/powerpc/sysdev/xics/icp-hv.c index c1917cf67c3d..e7fa26c4ff73 100644 --- a/arch/powerpc/sysdev/xics/icp-hv.c +++ b/arch/powerpc/sysdev/xics/icp-hv.c | |||
@@ -112,10 +112,10 @@ static unsigned int icp_hv_get_irq(void) | |||
112 | unsigned int irq; | 112 | unsigned int irq; |
113 | 113 | ||
114 | if (vec == XICS_IRQ_SPURIOUS) | 114 | if (vec == XICS_IRQ_SPURIOUS) |
115 | return NO_IRQ; | 115 | return 0; |
116 | 116 | ||
117 | irq = irq_find_mapping(xics_host, vec); | 117 | irq = irq_find_mapping(xics_host, vec); |
118 | if (likely(irq != NO_IRQ)) { | 118 | if (likely(irq)) { |
119 | xics_push_cppr(vec); | 119 | xics_push_cppr(vec); |
120 | return irq; | 120 | return irq; |
121 | } | 121 | } |
@@ -126,7 +126,7 @@ static unsigned int icp_hv_get_irq(void) | |||
126 | /* We might learn about it later, so EOI it */ | 126 | /* We might learn about it later, so EOI it */ |
127 | icp_hv_set_xirr(xirr); | 127 | icp_hv_set_xirr(xirr); |
128 | 128 | ||
129 | return NO_IRQ; | 129 | return 0; |
130 | } | 130 | } |
131 | 131 | ||
132 | static void icp_hv_set_cpu_priority(unsigned char cppr) | 132 | static void icp_hv_set_cpu_priority(unsigned char cppr) |
diff --git a/arch/powerpc/sysdev/xics/icp-native.c b/arch/powerpc/sysdev/xics/icp-native.c index afdf62f2a695..8a6a043e239b 100644 --- a/arch/powerpc/sysdev/xics/icp-native.c +++ b/arch/powerpc/sysdev/xics/icp-native.c | |||
@@ -124,10 +124,10 @@ static unsigned int icp_native_get_irq(void) | |||
124 | unsigned int irq; | 124 | unsigned int irq; |
125 | 125 | ||
126 | if (vec == XICS_IRQ_SPURIOUS) | 126 | if (vec == XICS_IRQ_SPURIOUS) |
127 | return NO_IRQ; | 127 | return 0; |
128 | 128 | ||
129 | irq = irq_find_mapping(xics_host, vec); | 129 | irq = irq_find_mapping(xics_host, vec); |
130 | if (likely(irq != NO_IRQ)) { | 130 | if (likely(irq)) { |
131 | xics_push_cppr(vec); | 131 | xics_push_cppr(vec); |
132 | return irq; | 132 | return irq; |
133 | } | 133 | } |
@@ -138,7 +138,7 @@ static unsigned int icp_native_get_irq(void) | |||
138 | /* We might learn about it later, so EOI it */ | 138 | /* We might learn about it later, so EOI it */ |
139 | icp_native_set_xirr(xirr); | 139 | icp_native_set_xirr(xirr); |
140 | 140 | ||
141 | return NO_IRQ; | 141 | return 0; |
142 | } | 142 | } |
143 | 143 | ||
144 | #ifdef CONFIG_SMP | 144 | #ifdef CONFIG_SMP |
diff --git a/arch/powerpc/sysdev/xics/icp-opal.c b/arch/powerpc/sysdev/xics/icp-opal.c index 57d72f10a97f..7357cfddb040 100644 --- a/arch/powerpc/sysdev/xics/icp-opal.c +++ b/arch/powerpc/sysdev/xics/icp-opal.c | |||
@@ -51,14 +51,14 @@ static unsigned int icp_opal_get_irq(void) | |||
51 | 51 | ||
52 | rc = opal_int_get_xirr(&xirr, false); | 52 | rc = opal_int_get_xirr(&xirr, false); |
53 | if (rc < 0) | 53 | if (rc < 0) |
54 | return NO_IRQ; | 54 | return 0; |
55 | xirr = be32_to_cpu(xirr); | 55 | xirr = be32_to_cpu(xirr); |
56 | vec = xirr & 0x00ffffff; | 56 | vec = xirr & 0x00ffffff; |
57 | if (vec == XICS_IRQ_SPURIOUS) | 57 | if (vec == XICS_IRQ_SPURIOUS) |
58 | return NO_IRQ; | 58 | return 0; |
59 | 59 | ||
60 | irq = irq_find_mapping(xics_host, vec); | 60 | irq = irq_find_mapping(xics_host, vec); |
61 | if (likely(irq != NO_IRQ)) { | 61 | if (likely(irq)) { |
62 | xics_push_cppr(vec); | 62 | xics_push_cppr(vec); |
63 | return irq; | 63 | return irq; |
64 | } | 64 | } |
@@ -69,7 +69,7 @@ static unsigned int icp_opal_get_irq(void) | |||
69 | /* We might learn about it later, so EOI it */ | 69 | /* We might learn about it later, so EOI it */ |
70 | opal_int_eoi(xirr); | 70 | opal_int_eoi(xirr); |
71 | 71 | ||
72 | return NO_IRQ; | 72 | return 0; |
73 | } | 73 | } |
74 | 74 | ||
75 | static void icp_opal_set_cpu_priority(unsigned char cppr) | 75 | static void icp_opal_set_cpu_priority(unsigned char cppr) |
diff --git a/arch/powerpc/sysdev/xics/xics-common.c b/arch/powerpc/sysdev/xics/xics-common.c index 9d530f479588..69d858e51ac7 100644 --- a/arch/powerpc/sysdev/xics/xics-common.c +++ b/arch/powerpc/sysdev/xics/xics-common.c | |||
@@ -131,7 +131,7 @@ static void xics_request_ipi(void) | |||
131 | unsigned int ipi; | 131 | unsigned int ipi; |
132 | 132 | ||
133 | ipi = irq_create_mapping(xics_host, XICS_IPI); | 133 | ipi = irq_create_mapping(xics_host, XICS_IPI); |
134 | BUG_ON(ipi == NO_IRQ); | 134 | BUG_ON(!ipi); |
135 | 135 | ||
136 | /* | 136 | /* |
137 | * IPIs are marked IRQF_PERCPU. The handler was set in map. | 137 | * IPIs are marked IRQF_PERCPU. The handler was set in map. |
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index b6819f0fc608..3f041b187033 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c | |||
@@ -236,7 +236,7 @@ static void macio_create_fixup_irq(struct macio_dev *dev, int index, | |||
236 | unsigned int irq; | 236 | unsigned int irq; |
237 | 237 | ||
238 | irq = irq_create_mapping(NULL, line); | 238 | irq = irq_create_mapping(NULL, line); |
239 | if (irq != NO_IRQ) { | 239 | if (!irq) { |
240 | dev->interrupt[index].start = irq; | 240 | dev->interrupt[index].start = irq; |
241 | dev->interrupt[index].flags = IORESOURCE_IRQ; | 241 | dev->interrupt[index].flags = IORESOURCE_IRQ; |
242 | dev->interrupt[index].name = dev_name(&dev->ofdev.dev); | 242 | dev->interrupt[index].name = dev_name(&dev->ofdev.dev); |
@@ -299,7 +299,7 @@ static void macio_setup_interrupts(struct macio_dev *dev) | |||
299 | break; | 299 | break; |
300 | res = &dev->interrupt[j]; | 300 | res = &dev->interrupt[j]; |
301 | irq = irq_of_parse_and_map(np, i++); | 301 | irq = irq_of_parse_and_map(np, i++); |
302 | if (irq == NO_IRQ) | 302 | if (!irq) |
303 | break; | 303 | break; |
304 | res->start = irq; | 304 | res->start = irq; |
305 | res->flags = IORESOURCE_IRQ; | 305 | res->flags = IORESOURCE_IRQ; |
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index 465c52219639..775527135b93 100644 --- a/drivers/macintosh/rack-meter.c +++ b/drivers/macintosh/rack-meter.c | |||
@@ -427,7 +427,7 @@ static int rackmeter_probe(struct macio_dev* mdev, | |||
427 | rm->irq = macio_irq(mdev, 1); | 427 | rm->irq = macio_irq(mdev, 1); |
428 | #else | 428 | #else |
429 | rm->irq = irq_of_parse_and_map(i2s, 1); | 429 | rm->irq = irq_of_parse_and_map(i2s, 1); |
430 | if (rm->irq == NO_IRQ || | 430 | if (!rm->irq || |
431 | of_address_to_resource(i2s, 0, &ri2s) || | 431 | of_address_to_resource(i2s, 0, &ri2s) || |
432 | of_address_to_resource(i2s, 1, &rdma)) { | 432 | of_address_to_resource(i2s, 1, &rdma)) { |
433 | printk(KERN_ERR | 433 | printk(KERN_ERR |
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index d6f72c826c1c..08edb2c25b60 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c | |||
@@ -279,7 +279,7 @@ int smu_queue_cmd(struct smu_cmd *cmd) | |||
279 | spin_unlock_irqrestore(&smu->lock, flags); | 279 | spin_unlock_irqrestore(&smu->lock, flags); |
280 | 280 | ||
281 | /* Workaround for early calls when irq isn't available */ | 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 | smu_spinwait_cmd(cmd); | 283 | smu_spinwait_cmd(cmd); |
284 | 284 | ||
285 | return 0; | 285 | return 0; |
@@ -498,8 +498,8 @@ int __init smu_init (void) | |||
498 | INIT_LIST_HEAD(&smu->cmd_list); | 498 | INIT_LIST_HEAD(&smu->cmd_list); |
499 | INIT_LIST_HEAD(&smu->cmd_i2c_list); | 499 | INIT_LIST_HEAD(&smu->cmd_i2c_list); |
500 | smu->of_node = np; | 500 | smu->of_node = np; |
501 | smu->db_irq = NO_IRQ; | 501 | smu->db_irq = 0; |
502 | smu->msg_irq = NO_IRQ; | 502 | smu->msg_irq = 0; |
503 | 503 | ||
504 | /* smu_cmdbuf_abs is in the low 2G of RAM, can be converted to a | 504 | /* smu_cmdbuf_abs is in the low 2G of RAM, can be converted to a |
505 | * 32 bits value safely | 505 | * 32 bits value safely |
@@ -587,13 +587,13 @@ static int smu_late_init(void) | |||
587 | 587 | ||
588 | if (smu->db_node) { | 588 | if (smu->db_node) { |
589 | smu->db_irq = irq_of_parse_and_map(smu->db_node, 0); | 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 | printk(KERN_ERR "smu: failed to map irq for node %s\n", | 591 | printk(KERN_ERR "smu: failed to map irq for node %s\n", |
592 | smu->db_node->full_name); | 592 | smu->db_node->full_name); |
593 | } | 593 | } |
594 | if (smu->msg_node) { | 594 | if (smu->msg_node) { |
595 | smu->msg_irq = irq_of_parse_and_map(smu->msg_node, 0); | 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 | printk(KERN_ERR "smu: failed to map irq for node %s\n", | 597 | printk(KERN_ERR "smu: failed to map irq for node %s\n", |
598 | smu->msg_node->full_name); | 598 | smu->msg_node->full_name); |
599 | } | 599 | } |
@@ -602,23 +602,23 @@ static int smu_late_init(void) | |||
602 | * Try to request the interrupts | 602 | * Try to request the interrupts |
603 | */ | 603 | */ |
604 | 604 | ||
605 | if (smu->db_irq != NO_IRQ) { | 605 | if (smu->db_irq) { |
606 | if (request_irq(smu->db_irq, smu_db_intr, | 606 | if (request_irq(smu->db_irq, smu_db_intr, |
607 | IRQF_SHARED, "SMU doorbell", smu) < 0) { | 607 | IRQF_SHARED, "SMU doorbell", smu) < 0) { |
608 | printk(KERN_WARNING "SMU: can't " | 608 | printk(KERN_WARNING "SMU: can't " |
609 | "request interrupt %d\n", | 609 | "request interrupt %d\n", |
610 | smu->db_irq); | 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 | if (request_irq(smu->msg_irq, smu_msg_intr, | 616 | if (request_irq(smu->msg_irq, smu_msg_intr, |
617 | IRQF_SHARED, "SMU message", smu) < 0) { | 617 | IRQF_SHARED, "SMU message", smu) < 0) { |
618 | printk(KERN_WARNING "SMU: can't " | 618 | printk(KERN_WARNING "SMU: can't " |
619 | "request interrupt %d\n", | 619 | "request interrupt %d\n", |
620 | smu->msg_irq); | 620 | smu->msg_irq); |
621 | smu->msg_irq = NO_IRQ; | 621 | smu->msg_irq = 0; |
622 | } | 622 | } |
623 | } | 623 | } |
624 | 624 | ||
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c index bad18130f125..2088e23a8002 100644 --- a/drivers/macintosh/via-cuda.c +++ b/drivers/macintosh/via-cuda.c | |||
@@ -209,7 +209,7 @@ static int __init via_cuda_start(void) | |||
209 | cuda_irq = IRQ_MAC_ADB; | 209 | cuda_irq = IRQ_MAC_ADB; |
210 | #else | 210 | #else |
211 | cuda_irq = irq_of_parse_and_map(vias, 0); | 211 | cuda_irq = irq_of_parse_and_map(vias, 0); |
212 | if (cuda_irq == NO_IRQ) { | 212 | if (!cuda_irq) { |
213 | printk(KERN_ERR "via-cuda: can't map interrupts for %s\n", | 213 | printk(KERN_ERR "via-cuda: can't map interrupts for %s\n", |
214 | vias->full_name); | 214 | vias->full_name); |
215 | return -ENODEV; | 215 | return -ENODEV; |
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index f8b6d1403c16..91081dcdc272 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c | |||
@@ -145,7 +145,7 @@ static int pmu_fully_inited; | |||
145 | static int pmu_has_adb; | 145 | static int pmu_has_adb; |
146 | static struct device_node *gpio_node; | 146 | static struct device_node *gpio_node; |
147 | static unsigned char __iomem *gpio_reg; | 147 | static unsigned char __iomem *gpio_reg; |
148 | static int gpio_irq = NO_IRQ; | 148 | static int gpio_irq = 0; |
149 | static int gpio_irq_enabled = -1; | 149 | static int gpio_irq_enabled = -1; |
150 | static volatile int pmu_suspended; | 150 | static volatile int pmu_suspended; |
151 | static spinlock_t pmu_lock; | 151 | static spinlock_t pmu_lock; |
@@ -402,7 +402,7 @@ static int __init via_pmu_start(void) | |||
402 | batt_req.complete = 1; | 402 | batt_req.complete = 1; |
403 | 403 | ||
404 | irq = irq_of_parse_and_map(vias, 0); | 404 | irq = irq_of_parse_and_map(vias, 0); |
405 | if (irq == NO_IRQ) { | 405 | if (!irq) { |
406 | printk(KERN_ERR "via-pmu: can't map interrupt\n"); | 406 | printk(KERN_ERR "via-pmu: can't map interrupt\n"); |
407 | return -ENODEV; | 407 | return -ENODEV; |
408 | } | 408 | } |
@@ -424,7 +424,7 @@ static int __init via_pmu_start(void) | |||
424 | if (gpio_node) | 424 | if (gpio_node) |
425 | gpio_irq = irq_of_parse_and_map(gpio_node, 0); | 425 | gpio_irq = irq_of_parse_and_map(gpio_node, 0); |
426 | 426 | ||
427 | if (gpio_irq != NO_IRQ) { | 427 | if (gpio_irq) { |
428 | if (request_irq(gpio_irq, gpio1_interrupt, | 428 | if (request_irq(gpio_irq, gpio1_interrupt, |
429 | IRQF_NO_SUSPEND, "GPIO1 ADB", | 429 | IRQF_NO_SUSPEND, "GPIO1 ADB", |
430 | (void *)0)) | 430 | (void *)0)) |
diff --git a/drivers/ps3/ps3-vuart.c b/drivers/ps3/ps3-vuart.c index 632701a1d993..b7f300b79ffd 100644 --- a/drivers/ps3/ps3-vuart.c +++ b/drivers/ps3/ps3-vuart.c | |||
@@ -958,7 +958,7 @@ static int ps3_vuart_bus_interrupt_get(void) | |||
958 | 958 | ||
959 | fail_request_irq: | 959 | fail_request_irq: |
960 | ps3_vuart_irq_destroy(vuart_bus_priv.virq); | 960 | ps3_vuart_irq_destroy(vuart_bus_priv.virq); |
961 | vuart_bus_priv.virq = NO_IRQ; | 961 | vuart_bus_priv.virq = 0; |
962 | fail_alloc_irq: | 962 | fail_alloc_irq: |
963 | kfree(vuart_bus_priv.bmp); | 963 | kfree(vuart_bus_priv.bmp); |
964 | vuart_bus_priv.bmp = NULL; | 964 | vuart_bus_priv.bmp = NULL; |
@@ -982,7 +982,7 @@ static int ps3_vuart_bus_interrupt_put(void) | |||
982 | free_irq(vuart_bus_priv.virq, &vuart_bus_priv); | 982 | free_irq(vuart_bus_priv.virq, &vuart_bus_priv); |
983 | 983 | ||
984 | ps3_vuart_irq_destroy(vuart_bus_priv.virq); | 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 | kfree(vuart_bus_priv.bmp); | 987 | kfree(vuart_bus_priv.bmp); |
988 | vuart_bus_priv.bmp = NULL; | 988 | vuart_bus_priv.bmp = NULL; |
diff --git a/sound/aoa/core/gpio-feature.c b/sound/aoa/core/gpio-feature.c index f34153962d07..71960089e207 100644 --- a/sound/aoa/core/gpio-feature.c +++ b/sound/aoa/core/gpio-feature.c | |||
@@ -118,7 +118,7 @@ static void get_irq(struct device_node * np, int *irqptr) | |||
118 | if (np) | 118 | if (np) |
119 | *irqptr = irq_of_parse_and_map(np, 0); | 119 | *irqptr = irq_of_parse_and_map(np, 0); |
120 | else | 120 | else |
121 | *irqptr = NO_IRQ; | 121 | *irqptr = 0; |
122 | } | 122 | } |
123 | 123 | ||
124 | /* 0x4 is outenable, 0x1 is out, thus 4 or 5 */ | 124 | /* 0x4 is outenable, 0x1 is out, thus 4 or 5 */ |
@@ -336,7 +336,7 @@ static int ftr_set_notify(struct gpio_runtime *rt, | |||
336 | return -EINVAL; | 336 | return -EINVAL; |
337 | } | 337 | } |
338 | 338 | ||
339 | if (irq == NO_IRQ) | 339 | if (!irq) |
340 | return -ENODEV; | 340 | return -ENODEV; |
341 | 341 | ||
342 | mutex_lock(¬if->mutex); | 342 | mutex_lock(¬if->mutex); |
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index c8fafba218a5..58ee8089bbf9 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c | |||
@@ -1303,19 +1303,19 @@ static int tumbler_init(struct snd_pmac *chip) | |||
1303 | &mix->line_mute, 1); | 1303 | &mix->line_mute, 1); |
1304 | irq = tumbler_find_device("headphone-detect", | 1304 | irq = tumbler_find_device("headphone-detect", |
1305 | NULL, &mix->hp_detect, 0); | 1305 | NULL, &mix->hp_detect, 0); |
1306 | if (irq <= NO_IRQ) | 1306 | if (irq <= 0) |
1307 | irq = tumbler_find_device("headphone-detect", | 1307 | irq = tumbler_find_device("headphone-detect", |
1308 | NULL, &mix->hp_detect, 1); | 1308 | NULL, &mix->hp_detect, 1); |
1309 | if (irq <= NO_IRQ) | 1309 | if (irq <= 0) |
1310 | irq = tumbler_find_device("keywest-gpio15", | 1310 | irq = tumbler_find_device("keywest-gpio15", |
1311 | NULL, &mix->hp_detect, 1); | 1311 | NULL, &mix->hp_detect, 1); |
1312 | mix->headphone_irq = irq; | 1312 | mix->headphone_irq = irq; |
1313 | irq = tumbler_find_device("line-output-detect", | 1313 | irq = tumbler_find_device("line-output-detect", |
1314 | NULL, &mix->line_detect, 0); | 1314 | NULL, &mix->line_detect, 0); |
1315 | if (irq <= NO_IRQ) | 1315 | if (irq <= 0) |
1316 | irq = tumbler_find_device("line-output-detect", | 1316 | irq = tumbler_find_device("line-output-detect", |
1317 | NULL, &mix->line_detect, 1); | 1317 | NULL, &mix->line_detect, 1); |
1318 | if (IS_G4DA && irq <= NO_IRQ) | 1318 | if (IS_G4DA && irq <= 0) |
1319 | irq = tumbler_find_device("keywest-gpio16", | 1319 | irq = tumbler_find_device("keywest-gpio16", |
1320 | NULL, &mix->line_detect, 1); | 1320 | NULL, &mix->line_detect, 1); |
1321 | mix->lineout_irq = irq; | 1321 | mix->lineout_irq = irq; |