Commit 10d7930d authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Li Yang

soc: fsl: qe: don't use NO_IRQ in qe_ic.c

This driver is currently PPC-only, and on powerpc, NO_IRQ is 0, so
this doesn't change functionality. However, not every architecture
defines NO_IRQ, and some define it as -1, so the detection of a failed
irq_of_parse_and_map() (which returns 0 on failure) would be wrong on
those. So to prepare for allowing this driver to build on other
architectures, drop all references to NO_IRQ.
Reviewed-by: default avatarTimur Tabi <timur@kernel.org>
Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarLi Yang <leoyang.li@nxp.com>
parent d7c2878c
...@@ -282,7 +282,7 @@ static const struct irq_domain_ops qe_ic_host_ops = { ...@@ -282,7 +282,7 @@ static const struct irq_domain_ops qe_ic_host_ops = {
.xlate = irq_domain_xlate_onetwocell, .xlate = irq_domain_xlate_onetwocell,
}; };
/* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ /* Return an interrupt vector or 0 if no interrupt is pending. */
unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic) unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic)
{ {
int irq; int irq;
...@@ -293,12 +293,12 @@ unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic) ...@@ -293,12 +293,12 @@ unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic)
irq = qe_ic_read(qe_ic->regs, QEIC_CIVEC) >> 26; irq = qe_ic_read(qe_ic->regs, QEIC_CIVEC) >> 26;
if (irq == 0) if (irq == 0)
return NO_IRQ; return 0;
return irq_linear_revmap(qe_ic->irqhost, irq); return irq_linear_revmap(qe_ic->irqhost, irq);
} }
/* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ /* Return an interrupt vector or 0 if no interrupt is pending. */
unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic) unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic)
{ {
int irq; int irq;
...@@ -309,7 +309,7 @@ unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic) ...@@ -309,7 +309,7 @@ unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic)
irq = qe_ic_read(qe_ic->regs, QEIC_CHIVEC) >> 26; irq = qe_ic_read(qe_ic->regs, QEIC_CHIVEC) >> 26;
if (irq == 0) if (irq == 0)
return NO_IRQ; return 0;
return irq_linear_revmap(qe_ic->irqhost, irq); return irq_linear_revmap(qe_ic->irqhost, irq);
} }
...@@ -320,7 +320,7 @@ static void qe_ic_cascade_low(struct irq_desc *desc) ...@@ -320,7 +320,7 @@ static void qe_ic_cascade_low(struct irq_desc *desc)
unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic);
struct irq_chip *chip = irq_desc_get_chip(desc); struct irq_chip *chip = irq_desc_get_chip(desc);
if (cascade_irq != NO_IRQ) if (cascade_irq != 0)
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
if (chip->irq_eoi) if (chip->irq_eoi)
...@@ -333,7 +333,7 @@ static void qe_ic_cascade_high(struct irq_desc *desc) ...@@ -333,7 +333,7 @@ static void qe_ic_cascade_high(struct irq_desc *desc)
unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic);
struct irq_chip *chip = irq_desc_get_chip(desc); struct irq_chip *chip = irq_desc_get_chip(desc);
if (cascade_irq != NO_IRQ) if (cascade_irq != 0)
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
if (chip->irq_eoi) if (chip->irq_eoi)
...@@ -347,10 +347,10 @@ static void qe_ic_cascade_muxed_mpic(struct irq_desc *desc) ...@@ -347,10 +347,10 @@ static void qe_ic_cascade_muxed_mpic(struct irq_desc *desc)
struct irq_chip *chip = irq_desc_get_chip(desc); struct irq_chip *chip = irq_desc_get_chip(desc);
cascade_irq = qe_ic_get_high_irq(qe_ic); cascade_irq = qe_ic_get_high_irq(qe_ic);
if (cascade_irq == NO_IRQ) if (cascade_irq == 0)
cascade_irq = qe_ic_get_low_irq(qe_ic); cascade_irq = qe_ic_get_low_irq(qe_ic);
if (cascade_irq != NO_IRQ) if (cascade_irq != 0)
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
chip->irq_eoi(&desc->irq_data); chip->irq_eoi(&desc->irq_data);
...@@ -386,7 +386,7 @@ static void __init qe_ic_init(struct device_node *node, unsigned int flags) ...@@ -386,7 +386,7 @@ static void __init qe_ic_init(struct device_node *node, unsigned int flags)
qe_ic->virq_high = irq_of_parse_and_map(node, 0); qe_ic->virq_high = irq_of_parse_and_map(node, 0);
qe_ic->virq_low = irq_of_parse_and_map(node, 1); qe_ic->virq_low = irq_of_parse_and_map(node, 1);
if (qe_ic->virq_low == NO_IRQ) { if (!qe_ic->virq_low) {
printk(KERN_ERR "Failed to map QE_IC low IRQ\n"); printk(KERN_ERR "Failed to map QE_IC low IRQ\n");
kfree(qe_ic); kfree(qe_ic);
return; return;
...@@ -423,8 +423,7 @@ static void __init qe_ic_init(struct device_node *node, unsigned int flags) ...@@ -423,8 +423,7 @@ static void __init qe_ic_init(struct device_node *node, unsigned int flags)
irq_set_handler_data(qe_ic->virq_low, qe_ic); irq_set_handler_data(qe_ic->virq_low, qe_ic);
irq_set_chained_handler(qe_ic->virq_low, low_handler); irq_set_chained_handler(qe_ic->virq_low, low_handler);
if (qe_ic->virq_high != NO_IRQ && if (qe_ic->virq_high && qe_ic->virq_high != qe_ic->virq_low) {
qe_ic->virq_high != qe_ic->virq_low) {
irq_set_handler_data(qe_ic->virq_high, qe_ic); irq_set_handler_data(qe_ic->virq_high, qe_ic);
irq_set_chained_handler(qe_ic->virq_high, high_handler); irq_set_chained_handler(qe_ic->virq_high, high_handler);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment