Merge branch 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
genirq: Provide locked setter for chip, handler, name
genirq: Provide a lockdep helper
genirq; Remove the last leftovers of the old sparse irq code

+34 -27
+34 -13
include/linux/irqdesc.h
··· 100 100 extern struct irq_desc irq_desc[NR_IRQS]; 101 101 #endif 102 102 103 - /* Will be removed once the last users in power and sh are gone */ 104 - extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node); 105 - static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node) 106 - { 107 - return desc; 108 - } 109 - 110 103 #ifdef CONFIG_GENERIC_HARDIRQS 111 104 112 105 static inline struct irq_data *irq_desc_get_irq_data(struct irq_desc *desc) ··· 171 178 return desc->action != NULL; 172 179 } 173 180 181 + /* caller has locked the irq_desc and both params are valid */ 182 + static inline void __irq_set_handler_locked(unsigned int irq, 183 + irq_flow_handler_t handler) 184 + { 185 + struct irq_desc *desc; 186 + 187 + desc = irq_to_desc(irq); 188 + desc->handle_irq = handler; 189 + } 190 + 191 + /* caller has locked the irq_desc and both params are valid */ 192 + static inline void 193 + __irq_set_chip_handler_name_locked(unsigned int irq, struct irq_chip *chip, 194 + irq_flow_handler_t handler, const char *name) 195 + { 196 + struct irq_desc *desc; 197 + 198 + desc = irq_to_desc(irq); 199 + irq_desc_get_irq_data(desc)->chip = chip; 200 + desc->handle_irq = handler; 201 + desc->name = name; 202 + } 203 + 174 204 #ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT 205 + static inline void __set_irq_handler_unlocked(int irq, 206 + irq_flow_handler_t handler) 207 + { 208 + __irq_set_handler_locked(irq, handler); 209 + } 210 + 175 211 static inline int irq_balancing_disabled(unsigned int irq) 176 212 { 177 213 struct irq_desc *desc; ··· 210 188 } 211 189 #endif 212 190 213 - /* caller has locked the irq_desc and both params are valid */ 214 - static inline void __set_irq_handler_unlocked(int irq, 215 - irq_flow_handler_t handler) 191 + static inline void 192 + irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class) 216 193 { 217 - struct irq_desc *desc; 194 + struct irq_desc *desc = irq_to_desc(irq); 218 195 219 - desc = irq_to_desc(irq); 220 - desc->handle_irq = handler; 196 + if (desc) 197 + lockdep_set_class(&desc->lock, class); 221 198 } 222 199 223 200 #ifdef CONFIG_IRQ_PREFLOW_FASTEOI
-14
kernel/irq/irqdesc.c
··· 198 198 return -ENOMEM; 199 199 } 200 200 201 - struct irq_desc * __ref irq_to_desc_alloc_node(unsigned int irq, int node) 202 - { 203 - int res = irq_alloc_descs(irq, irq, 1, node); 204 - 205 - if (res == -EEXIST || res == irq) 206 - return irq_to_desc(irq); 207 - return NULL; 208 - } 209 - 210 201 static int irq_expand_nr_irqs(unsigned int nr) 211 202 { 212 203 if (nr > IRQ_BITMAP_BITS) ··· 272 281 struct irq_desc *irq_to_desc(unsigned int irq) 273 282 { 274 283 return (irq < NR_IRQS) ? irq_desc + irq : NULL; 275 - } 276 - 277 - struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node) 278 - { 279 - return irq_to_desc(irq); 280 284 } 281 285 282 286 static void free_desc(unsigned int irq)