aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/irqdesc.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-03-23 08:10:31 -0400
committerThomas Gleixner <tglx@linutronix.de>2011-03-23 15:22:06 -0400
commita2e8461a2ce5e8140b7374eb68af0d09e36e07ff (patch)
treeb4905feaba6dc8f7162fd3846b94d72e0f736d48 /include/linux/irqdesc.h
parentd3e17deb1790ee2123e9d11420be6411d1768b47 (diff)
genirq: Provide locked setter for chip, handler, name
Some irq_set_type() callbacks need to change the chip and the handler when the trigger mode changes. We have already a (misnomed) setter function for the handler which can be called from irq_set_type(). Provide one which allows to set chip and name as well. Put the misnomed function under the COMPAT switch and provide a replacement. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/irqdesc.h')
-rw-r--r--include/linux/irqdesc.h29
1 files changed, 24 insertions, 5 deletions
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 1595f9176b43..15e6c3905f41 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -171,25 +171,44 @@ static inline int irq_has_action(unsigned int irq)
171 return desc->action != NULL; 171 return desc->action != NULL;
172} 172}
173 173
174#ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT 174/* caller has locked the irq_desc and both params are valid */
175static inline int irq_balancing_disabled(unsigned int irq) 175static inline void __irq_set_handler_locked(unsigned int irq,
176 irq_flow_handler_t handler)
176{ 177{
177 struct irq_desc *desc; 178 struct irq_desc *desc;
178 179
179 desc = irq_to_desc(irq); 180 desc = irq_to_desc(irq);
180 return desc->status & IRQ_NO_BALANCING_MASK; 181 desc->handle_irq = handler;
181} 182}
182#endif
183 183
184/* caller has locked the irq_desc and both params are valid */ 184/* caller has locked the irq_desc and both params are valid */
185static inline void
186__irq_set_chip_handler_name_locked(unsigned int irq, struct irq_chip *chip,
187 irq_flow_handler_t handler, const char *name)
188{
189 struct irq_desc *desc;
190
191 desc = irq_to_desc(irq);
192 irq_desc_get_irq_data(desc)->chip = chip;
193 desc->handle_irq = handler;
194 desc->name = name;
195}
196
197#ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
185static inline void __set_irq_handler_unlocked(int irq, 198static inline void __set_irq_handler_unlocked(int irq,
186 irq_flow_handler_t handler) 199 irq_flow_handler_t handler)
187{ 200{
201 __irq_set_handler_locked(irq, handler);
202}
203
204static inline int irq_balancing_disabled(unsigned int irq)
205{
188 struct irq_desc *desc; 206 struct irq_desc *desc;
189 207
190 desc = irq_to_desc(irq); 208 desc = irq_to_desc(irq);
191 desc->handle_irq = handler; 209 return desc->status & IRQ_NO_BALANCING_MASK;
192} 210}
211#endif
193 212
194static inline void 213static inline void
195irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class) 214irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class)