aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/chip.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-10-01 06:58:38 -0400
committerThomas Gleixner <tglx@linutronix.de>2010-10-04 06:36:26 -0400
commit6b8ff3120c758340505dddf08ad685ebb841d5d5 (patch)
tree794eed27c6f9a8931b8fdf4a7ae60a1560b237fc /kernel/irq/chip.c
parentff7dcd44dd446db2c3e13bdedf2d52b8e0127f16 (diff)
genirq: Convert core code to irq_data
Convert all references in the core code to orq, chip, handler_data, chip_data, msi_desc, affinity to irq_data.* Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/irq/chip.c')
-rw-r--r--kernel/irq/chip.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 4ea775cc60f0..e0e93ff10afd 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -32,18 +32,18 @@ static void dynamic_irq_init_x(unsigned int irq, bool keep_chip_data)
32 /* Ensure we don't have left over values from a previous use of this irq */ 32 /* Ensure we don't have left over values from a previous use of this irq */
33 raw_spin_lock_irqsave(&desc->lock, flags); 33 raw_spin_lock_irqsave(&desc->lock, flags);
34 desc->status = IRQ_DISABLED; 34 desc->status = IRQ_DISABLED;
35 desc->chip = &no_irq_chip; 35 desc->irq_data.chip = &no_irq_chip;
36 desc->handle_irq = handle_bad_irq; 36 desc->handle_irq = handle_bad_irq;
37 desc->depth = 1; 37 desc->depth = 1;
38 desc->msi_desc = NULL; 38 desc->irq_data.msi_desc = NULL;
39 desc->handler_data = NULL; 39 desc->irq_data.handler_data = NULL;
40 if (!keep_chip_data) 40 if (!keep_chip_data)
41 desc->chip_data = NULL; 41 desc->irq_data.chip_data = NULL;
42 desc->action = NULL; 42 desc->action = NULL;
43 desc->irq_count = 0; 43 desc->irq_count = 0;
44 desc->irqs_unhandled = 0; 44 desc->irqs_unhandled = 0;
45#ifdef CONFIG_SMP 45#ifdef CONFIG_SMP
46 cpumask_setall(desc->affinity); 46 cpumask_setall(desc->irq_data.affinity);
47#ifdef CONFIG_GENERIC_PENDING_IRQ 47#ifdef CONFIG_GENERIC_PENDING_IRQ
48 cpumask_clear(desc->pending_mask); 48 cpumask_clear(desc->pending_mask);
49#endif 49#endif
@@ -64,7 +64,7 @@ void dynamic_irq_init(unsigned int irq)
64 * dynamic_irq_init_keep_chip_data - initialize a dynamically allocated irq 64 * dynamic_irq_init_keep_chip_data - initialize a dynamically allocated irq
65 * @irq: irq number to initialize 65 * @irq: irq number to initialize
66 * 66 *
67 * does not set irq_to_desc(irq)->chip_data to NULL 67 * does not set irq_to_desc(irq)->irq_data.chip_data to NULL
68 */ 68 */
69void dynamic_irq_init_keep_chip_data(unsigned int irq) 69void dynamic_irq_init_keep_chip_data(unsigned int irq)
70{ 70{
@@ -88,12 +88,12 @@ static void dynamic_irq_cleanup_x(unsigned int irq, bool keep_chip_data)
88 irq); 88 irq);
89 return; 89 return;
90 } 90 }
91 desc->msi_desc = NULL; 91 desc->irq_data.msi_desc = NULL;
92 desc->handler_data = NULL; 92 desc->irq_data.handler_data = NULL;
93 if (!keep_chip_data) 93 if (!keep_chip_data)
94 desc->chip_data = NULL; 94 desc->irq_data.chip_data = NULL;
95 desc->handle_irq = handle_bad_irq; 95 desc->handle_irq = handle_bad_irq;
96 desc->chip = &no_irq_chip; 96 desc->irq_data.chip = &no_irq_chip;
97 desc->name = NULL; 97 desc->name = NULL;
98 clear_kstat_irqs(desc); 98 clear_kstat_irqs(desc);
99 raw_spin_unlock_irqrestore(&desc->lock, flags); 99 raw_spin_unlock_irqrestore(&desc->lock, flags);
@@ -112,7 +112,7 @@ void dynamic_irq_cleanup(unsigned int irq)
112 * dynamic_irq_cleanup_keep_chip_data - cleanup a dynamically allocated irq 112 * dynamic_irq_cleanup_keep_chip_data - cleanup a dynamically allocated irq
113 * @irq: irq number to initialize 113 * @irq: irq number to initialize
114 * 114 *
115 * does not set irq_to_desc(irq)->chip_data to NULL 115 * does not set irq_to_desc(irq)->irq_data.chip_data to NULL
116 */ 116 */
117void dynamic_irq_cleanup_keep_chip_data(unsigned int irq) 117void dynamic_irq_cleanup_keep_chip_data(unsigned int irq)
118{ 118{
@@ -140,7 +140,7 @@ int set_irq_chip(unsigned int irq, struct irq_chip *chip)
140 140
141 raw_spin_lock_irqsave(&desc->lock, flags); 141 raw_spin_lock_irqsave(&desc->lock, flags);
142 irq_chip_set_defaults(chip); 142 irq_chip_set_defaults(chip);
143 desc->chip = chip; 143 desc->irq_data.chip = chip;
144 raw_spin_unlock_irqrestore(&desc->lock, flags); 144 raw_spin_unlock_irqrestore(&desc->lock, flags);
145 145
146 return 0; 146 return 0;
@@ -193,7 +193,7 @@ int set_irq_data(unsigned int irq, void *data)
193 } 193 }
194 194
195 raw_spin_lock_irqsave(&desc->lock, flags); 195 raw_spin_lock_irqsave(&desc->lock, flags);
196 desc->handler_data = data; 196 desc->irq_data.handler_data = data;
197 raw_spin_unlock_irqrestore(&desc->lock, flags); 197 raw_spin_unlock_irqrestore(&desc->lock, flags);
198 return 0; 198 return 0;
199} 199}
@@ -218,7 +218,7 @@ int set_irq_msi(unsigned int irq, struct msi_desc *entry)
218 } 218 }
219 219
220 raw_spin_lock_irqsave(&desc->lock, flags); 220 raw_spin_lock_irqsave(&desc->lock, flags);
221 desc->msi_desc = entry; 221 desc->irq_data.msi_desc = entry;
222 if (entry) 222 if (entry)
223 entry->irq = irq; 223 entry->irq = irq;
224 raw_spin_unlock_irqrestore(&desc->lock, flags); 224 raw_spin_unlock_irqrestore(&desc->lock, flags);
@@ -243,13 +243,13 @@ int set_irq_chip_data(unsigned int irq, void *data)
243 return -EINVAL; 243 return -EINVAL;
244 } 244 }
245 245
246 if (!desc->chip) { 246 if (!desc->irq_data.chip) {
247 printk(KERN_ERR "BUG: bad set_irq_chip_data(IRQ#%d)\n", irq); 247 printk(KERN_ERR "BUG: bad set_irq_chip_data(IRQ#%d)\n", irq);
248 return -EINVAL; 248 return -EINVAL;
249 } 249 }
250 250
251 raw_spin_lock_irqsave(&desc->lock, flags); 251 raw_spin_lock_irqsave(&desc->lock, flags);
252 desc->chip_data = data; 252 desc->irq_data.chip_data = data;
253 raw_spin_unlock_irqrestore(&desc->lock, flags); 253 raw_spin_unlock_irqrestore(&desc->lock, flags);
254 254
255 return 0; 255 return 0;
@@ -291,7 +291,7 @@ static void default_enable(unsigned int irq)
291{ 291{
292 struct irq_desc *desc = irq_to_desc(irq); 292 struct irq_desc *desc = irq_to_desc(irq);
293 293
294 desc->chip->unmask(irq); 294 desc->irq_data.chip->unmask(irq);
295 desc->status &= ~IRQ_MASKED; 295 desc->status &= ~IRQ_MASKED;
296} 296}
297 297
@@ -309,7 +309,7 @@ static unsigned int default_startup(unsigned int irq)
309{ 309{
310 struct irq_desc *desc = irq_to_desc(irq); 310 struct irq_desc *desc = irq_to_desc(irq);
311 311
312 desc->chip->enable(irq); 312 desc->irq_data.chip->enable(irq);
313 return 0; 313 return 0;
314} 314}
315 315
@@ -320,7 +320,7 @@ static void default_shutdown(unsigned int irq)
320{ 320{
321 struct irq_desc *desc = irq_to_desc(irq); 321 struct irq_desc *desc = irq_to_desc(irq);
322 322
323 desc->chip->mask(irq); 323 desc->irq_data.chip->mask(irq);
324 desc->status |= IRQ_MASKED; 324 desc->status |= IRQ_MASKED;
325} 325}
326 326
@@ -350,28 +350,28 @@ void irq_chip_set_defaults(struct irq_chip *chip)
350 350
351static inline void mask_ack_irq(struct irq_desc *desc, int irq) 351static inline void mask_ack_irq(struct irq_desc *desc, int irq)
352{ 352{
353 if (desc->chip->mask_ack) 353 if (desc->irq_data.chip->mask_ack)
354 desc->chip->mask_ack(irq); 354 desc->irq_data.chip->mask_ack(irq);
355 else { 355 else {
356 desc->chip->mask(irq); 356 desc->irq_data.chip->mask(irq);
357 if (desc->chip->ack) 357 if (desc->irq_data.chip->ack)
358 desc->chip->ack(irq); 358 desc->irq_data.chip->ack(irq);
359 } 359 }
360 desc->status |= IRQ_MASKED; 360 desc->status |= IRQ_MASKED;
361} 361}
362 362
363static inline void mask_irq(struct irq_desc *desc, int irq) 363static inline void mask_irq(struct irq_desc *desc, int irq)
364{ 364{
365 if (desc->chip->mask) { 365 if (desc->irq_data.chip->mask) {
366 desc->chip->mask(irq); 366 desc->irq_data.chip->mask(irq);
367 desc->status |= IRQ_MASKED; 367 desc->status |= IRQ_MASKED;
368 } 368 }
369} 369}
370 370
371static inline void unmask_irq(struct irq_desc *desc, int irq) 371static inline void unmask_irq(struct irq_desc *desc, int irq)
372{ 372{
373 if (desc->chip->unmask) { 373 if (desc->irq_data.chip->unmask) {
374 desc->chip->unmask(irq); 374 desc->irq_data.chip->unmask(irq);
375 desc->status &= ~IRQ_MASKED; 375 desc->status &= ~IRQ_MASKED;
376 } 376 }
377} 377}
@@ -552,7 +552,7 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
552 raw_spin_lock(&desc->lock); 552 raw_spin_lock(&desc->lock);
553 desc->status &= ~IRQ_INPROGRESS; 553 desc->status &= ~IRQ_INPROGRESS;
554out: 554out:
555 desc->chip->eoi(irq); 555 desc->irq_data.chip->eoi(irq);
556 556
557 raw_spin_unlock(&desc->lock); 557 raw_spin_unlock(&desc->lock);
558} 558}
@@ -594,8 +594,8 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
594 kstat_incr_irqs_this_cpu(irq, desc); 594 kstat_incr_irqs_this_cpu(irq, desc);
595 595
596 /* Start handling the irq */ 596 /* Start handling the irq */
597 if (desc->chip->ack) 597 if (desc->irq_data.chip->ack)
598 desc->chip->ack(irq); 598 desc->irq_data.chip->ack(irq);
599 599
600 /* Mark the IRQ currently in progress.*/ 600 /* Mark the IRQ currently in progress.*/
601 desc->status |= IRQ_INPROGRESS; 601 desc->status |= IRQ_INPROGRESS;
@@ -648,15 +648,15 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
648 648
649 kstat_incr_irqs_this_cpu(irq, desc); 649 kstat_incr_irqs_this_cpu(irq, desc);
650 650
651 if (desc->chip->ack) 651 if (desc->irq_data.chip->ack)
652 desc->chip->ack(irq); 652 desc->irq_data.chip->ack(irq);
653 653
654 action_ret = handle_IRQ_event(irq, desc->action); 654 action_ret = handle_IRQ_event(irq, desc->action);
655 if (!noirqdebug) 655 if (!noirqdebug)
656 note_interrupt(irq, desc, action_ret); 656 note_interrupt(irq, desc, action_ret);
657 657
658 if (desc->chip->eoi) 658 if (desc->irq_data.chip->eoi)
659 desc->chip->eoi(irq); 659 desc->irq_data.chip->eoi(irq);
660} 660}
661 661
662void 662void
@@ -674,7 +674,7 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
674 674
675 if (!handle) 675 if (!handle)
676 handle = handle_bad_irq; 676 handle = handle_bad_irq;
677 else if (desc->chip == &no_irq_chip) { 677 else if (desc->irq_data.chip == &no_irq_chip) {
678 printk(KERN_WARNING "Trying to install %sinterrupt handler " 678 printk(KERN_WARNING "Trying to install %sinterrupt handler "
679 "for IRQ%d\n", is_chained ? "chained " : "", irq); 679 "for IRQ%d\n", is_chained ? "chained " : "", irq);
680 /* 680 /*
@@ -684,7 +684,7 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
684 * prevent us to setup the interrupt at all. Switch it to 684 * prevent us to setup the interrupt at all. Switch it to
685 * dummy_irq_chip for easy transition. 685 * dummy_irq_chip for easy transition.
686 */ 686 */
687 desc->chip = &dummy_irq_chip; 687 desc->irq_data.chip = &dummy_irq_chip;
688 } 688 }
689 689
690 chip_bus_lock(irq, desc); 690 chip_bus_lock(irq, desc);
@@ -692,7 +692,7 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
692 692
693 /* Uninstall? */ 693 /* Uninstall? */
694 if (handle == handle_bad_irq) { 694 if (handle == handle_bad_irq) {
695 if (desc->chip != &no_irq_chip) 695 if (desc->irq_data.chip != &no_irq_chip)
696 mask_ack_irq(desc, irq); 696 mask_ack_irq(desc, irq);
697 desc->status |= IRQ_DISABLED; 697 desc->status |= IRQ_DISABLED;
698 desc->depth = 1; 698 desc->depth = 1;
@@ -704,7 +704,7 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
704 desc->status &= ~IRQ_DISABLED; 704 desc->status &= ~IRQ_DISABLED;
705 desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE; 705 desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE;
706 desc->depth = 0; 706 desc->depth = 0;
707 desc->chip->startup(irq); 707 desc->irq_data.chip->startup(irq);
708 } 708 }
709 raw_spin_unlock_irqrestore(&desc->lock, flags); 709 raw_spin_unlock_irqrestore(&desc->lock, flags);
710 chip_bus_sync_unlock(irq, desc); 710 chip_bus_sync_unlock(irq, desc);