@@ -1136,8 +1136,15 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
* If the trigger type is not specified by the caller,
* then use the default for this interrupt.
*/
- if (!(new->flags & IRQF_TRIGGER_MASK))
- new->flags |= irqd_get_trigger_type(&desc->irq_data);
+ flags = irqd_get_trigger_type(&desc->irq_data);
+ if (!(new->flags & IRQF_TRIGGER_MASK)) {
+ new->flags |= flags;
+ } else if ((new->flags & IRQF_TRIGGER_MASK) != flags) {
+ pr_err("Requested trigger type %i does not match default %lu\n",
+ new->flags & IRQF_TRIGGER_MASK,
+ flags);
+ return -EINVAL;
+ }
/*
* Check whether the interrupt nests into another interrupt