diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2011-03-23 08:10:31 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2011-03-23 15:22:06 -0400 |
| commit | a2e8461a2ce5e8140b7374eb68af0d09e36e07ff (patch) | |
| tree | b4905feaba6dc8f7162fd3846b94d72e0f736d48 /include/linux | |
| parent | d3e17deb1790ee2123e9d11420be6411d1768b47 (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')
| -rw-r--r-- | include/linux/irqdesc.h | 29 |
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 */ |
| 175 | static inline int irq_balancing_disabled(unsigned int irq) | 175 | static 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 */ |
| 185 | static 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 | ||
| 185 | static inline void __set_irq_handler_unlocked(int irq, | 198 | static 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 | |||
| 204 | static 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 | ||
| 194 | static inline void | 213 | static inline void |
| 195 | irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class) | 214 | irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class) |
