diff options
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r-- | kernel/irq/manage.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index ad2ce72c83c4..c498a1b8c621 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -140,10 +140,9 @@ int irq_select_affinity(unsigned int irq) | |||
140 | */ | 140 | */ |
141 | void disable_irq_nosync(unsigned int irq) | 141 | void disable_irq_nosync(unsigned int irq) |
142 | { | 142 | { |
143 | struct irq_desc *desc; | 143 | struct irq_desc *desc = irq_to_desc(irq); |
144 | unsigned long flags; | 144 | unsigned long flags; |
145 | 145 | ||
146 | desc = irq_to_desc(irq); | ||
147 | if (!desc) | 146 | if (!desc) |
148 | return; | 147 | return; |
149 | 148 | ||
@@ -170,9 +169,8 @@ EXPORT_SYMBOL(disable_irq_nosync); | |||
170 | */ | 169 | */ |
171 | void disable_irq(unsigned int irq) | 170 | void disable_irq(unsigned int irq) |
172 | { | 171 | { |
173 | struct irq_desc *desc; | 172 | struct irq_desc *desc = irq_to_desc(irq); |
174 | 173 | ||
175 | desc = irq_to_desc(irq); | ||
176 | if (!desc) | 174 | if (!desc) |
177 | return; | 175 | return; |
178 | 176 | ||
@@ -213,10 +211,9 @@ static void __enable_irq(struct irq_desc *desc, unsigned int irq) | |||
213 | */ | 211 | */ |
214 | void enable_irq(unsigned int irq) | 212 | void enable_irq(unsigned int irq) |
215 | { | 213 | { |
216 | struct irq_desc *desc; | 214 | struct irq_desc *desc = irq_to_desc(irq); |
217 | unsigned long flags; | 215 | unsigned long flags; |
218 | 216 | ||
219 | desc = irq_to_desc(irq); | ||
220 | if (!desc) | 217 | if (!desc) |
221 | return; | 218 | return; |
222 | 219 | ||
@@ -291,10 +288,9 @@ EXPORT_SYMBOL(set_irq_wake); | |||
291 | */ | 288 | */ |
292 | int can_request_irq(unsigned int irq, unsigned long irqflags) | 289 | int can_request_irq(unsigned int irq, unsigned long irqflags) |
293 | { | 290 | { |
294 | struct irq_desc *desc; | 291 | struct irq_desc *desc = irq_to_desc(irq); |
295 | struct irqaction *action; | 292 | struct irqaction *action; |
296 | 293 | ||
297 | desc = irq_to_desc(irq); | ||
298 | if (!desc) | 294 | if (!desc) |
299 | return 0; | 295 | return 0; |
300 | 296 | ||
@@ -355,16 +351,15 @@ int __irq_set_trigger(struct irq_desc *desc, unsigned int irq, | |||
355 | * Internal function to register an irqaction - typically used to | 351 | * Internal function to register an irqaction - typically used to |
356 | * allocate special interrupts that are part of the architecture. | 352 | * allocate special interrupts that are part of the architecture. |
357 | */ | 353 | */ |
358 | int setup_irq(unsigned int irq, struct irqaction *new) | 354 | static int |
355 | __setup_irq(unsigned int irq, struct irq_desc * desc, struct irqaction *new) | ||
359 | { | 356 | { |
360 | struct irq_desc *desc; | ||
361 | struct irqaction *old, **p; | 357 | struct irqaction *old, **p; |
362 | const char *old_name = NULL; | 358 | const char *old_name = NULL; |
363 | unsigned long flags; | 359 | unsigned long flags; |
364 | int shared = 0; | 360 | int shared = 0; |
365 | int ret; | 361 | int ret; |
366 | 362 | ||
367 | desc = irq_to_desc(irq); | ||
368 | if (!desc) | 363 | if (!desc) |
369 | return -EINVAL; | 364 | return -EINVAL; |
370 | 365 | ||
@@ -504,6 +499,20 @@ mismatch: | |||
504 | } | 499 | } |
505 | 500 | ||
506 | /** | 501 | /** |
502 | * setup_irq - setup an interrupt | ||
503 | * @irq: Interrupt line to setup | ||
504 | * @act: irqaction for the interrupt | ||
505 | * | ||
506 | * Used to statically setup interrupts in the early boot process. | ||
507 | */ | ||
508 | int setup_irq(unsigned int irq, struct irqaction *act) | ||
509 | { | ||
510 | struct irq_desc *desc = irq_to_desc(irq); | ||
511 | |||
512 | return __setup_irq(irq, desc, act); | ||
513 | } | ||
514 | |||
515 | /** | ||
507 | * free_irq - free an interrupt | 516 | * free_irq - free an interrupt |
508 | * @irq: Interrupt line to free | 517 | * @irq: Interrupt line to free |
509 | * @dev_id: Device identity to free | 518 | * @dev_id: Device identity to free |
@@ -519,13 +528,12 @@ mismatch: | |||
519 | */ | 528 | */ |
520 | void free_irq(unsigned int irq, void *dev_id) | 529 | void free_irq(unsigned int irq, void *dev_id) |
521 | { | 530 | { |
522 | struct irq_desc *desc; | 531 | struct irq_desc *desc = irq_to_desc(irq); |
523 | struct irqaction **p; | 532 | struct irqaction **p; |
524 | unsigned long flags; | 533 | unsigned long flags; |
525 | 534 | ||
526 | WARN_ON(in_interrupt()); | 535 | WARN_ON(in_interrupt()); |
527 | 536 | ||
528 | desc = irq_to_desc(irq); | ||
529 | if (!desc) | 537 | if (!desc) |
530 | return; | 538 | return; |
531 | 539 | ||
@@ -624,8 +632,8 @@ int request_irq(unsigned int irq, irq_handler_t handler, | |||
624 | unsigned long irqflags, const char *devname, void *dev_id) | 632 | unsigned long irqflags, const char *devname, void *dev_id) |
625 | { | 633 | { |
626 | struct irqaction *action; | 634 | struct irqaction *action; |
627 | int retval; | ||
628 | struct irq_desc *desc; | 635 | struct irq_desc *desc; |
636 | int retval; | ||
629 | 637 | ||
630 | #ifdef CONFIG_LOCKDEP | 638 | #ifdef CONFIG_LOCKDEP |
631 | /* | 639 | /* |
@@ -662,7 +670,7 @@ int request_irq(unsigned int irq, irq_handler_t handler, | |||
662 | action->next = NULL; | 670 | action->next = NULL; |
663 | action->dev_id = dev_id; | 671 | action->dev_id = dev_id; |
664 | 672 | ||
665 | retval = setup_irq(irq, action); | 673 | retval = __setup_irq(irq, desc, action); |
666 | if (retval) | 674 | if (retval) |
667 | kfree(action); | 675 | kfree(action); |
668 | 676 | ||