aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-09-28 04:40:18 -0400
committerThomas Gleixner <tglx@linutronix.de>2010-10-12 10:39:05 -0400
commit442471848f5abb55b99cba1229301655f67492b4 (patch)
tree4265a98a62db515d2b0a63d95a7c7e5badb1dbc0 /kernel
parent3a3856d00c74560a7b8d9f8a13c1ca94ee786b78 (diff)
genirq: Provide status modifier
Provide a irq_desc.status modifier function to cleanup the direct access to irq_desc in arch and driver code. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/chip.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 323547983f15..2b1f6906b824 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -851,32 +851,20 @@ set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
851 __set_irq_handler(irq, handle, 0, name); 851 __set_irq_handler(irq, handle, 0, name);
852} 852}
853 853
854void set_irq_noprobe(unsigned int irq) 854void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set)
855{ 855{
856 struct irq_desc *desc = irq_to_desc(irq); 856 struct irq_desc *desc = irq_to_desc(irq);
857 unsigned long flags; 857 unsigned long flags;
858 858
859 if (!desc) { 859 if (!desc)
860 printk(KERN_ERR "Trying to mark IRQ%d non-probeable\n", irq);
861 return; 860 return;
862 }
863
864 raw_spin_lock_irqsave(&desc->lock, flags);
865 desc->status |= IRQ_NOPROBE;
866 raw_spin_unlock_irqrestore(&desc->lock, flags);
867}
868 861
869void set_irq_probe(unsigned int irq) 862 /* Sanitize flags */
870{ 863 set &= IRQF_MODIFY_MASK;
871 struct irq_desc *desc = irq_to_desc(irq); 864 clr &= IRQF_MODIFY_MASK;
872 unsigned long flags;
873
874 if (!desc) {
875 printk(KERN_ERR "Trying to mark IRQ%d probeable\n", irq);
876 return;
877 }
878 865
879 raw_spin_lock_irqsave(&desc->lock, flags); 866 raw_spin_lock_irqsave(&desc->lock, flags);
880 desc->status &= ~IRQ_NOPROBE; 867 desc->status &= ~clr;
868 desc->status |= set;
881 raw_spin_unlock_irqrestore(&desc->lock, flags); 869 raw_spin_unlock_irqrestore(&desc->lock, flags);
882} 870}