Commit 3836ca08aad4575c120ccf328652f3873eea9063
1 parent
02725e7471
Exists in
master
and in
7 other branches
genirq: Consolidate set_chip_handler functions
No need to have separate functions if we have one plus inline wrappers. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Showing 2 changed files with 43 additions and 24 deletions Side-by-side Diff
include/linux/irq.h
... | ... | @@ -398,23 +398,23 @@ |
398 | 398 | extern struct irq_chip dummy_irq_chip; |
399 | 399 | |
400 | 400 | extern void |
401 | -set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip, | |
402 | - irq_flow_handler_t handle); | |
403 | -extern void | |
404 | -set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip, | |
401 | +irq_set_chip_and_handler_name(unsigned int irq, struct irq_chip *chip, | |
405 | 402 | irq_flow_handler_t handle, const char *name); |
406 | 403 | |
404 | +static inline void irq_set_chip_and_handler(unsigned int irq, struct irq_chip *chip, | |
405 | + irq_flow_handler_t handle) | |
406 | +{ | |
407 | + irq_set_chip_and_handler_name(irq, chip, handle, NULL); | |
408 | +} | |
409 | + | |
407 | 410 | extern void |
408 | -__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained, | |
411 | +__irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained, | |
409 | 412 | const char *name); |
410 | 413 | |
411 | -/* | |
412 | - * Set a highlevel flow handler for a given IRQ: | |
413 | - */ | |
414 | 414 | static inline void |
415 | -set_irq_handler(unsigned int irq, irq_flow_handler_t handle) | |
415 | +irq_set_handler(unsigned int irq, irq_flow_handler_t handle) | |
416 | 416 | { |
417 | - __set_irq_handler(irq, handle, 0, NULL); | |
417 | + __irq_set_handler(irq, handle, 0, NULL); | |
418 | 418 | } |
419 | 419 | |
420 | 420 | /* |
421 | 421 | |
... | ... | @@ -423,9 +423,9 @@ |
423 | 423 | * IRQ_NOREQUEST and IRQ_NOPROBE) |
424 | 424 | */ |
425 | 425 | static inline void |
426 | -set_irq_chained_handler(unsigned int irq, irq_flow_handler_t handle) | |
426 | +irq_set_chained_handler(unsigned int irq, irq_flow_handler_t handle) | |
427 | 427 | { |
428 | - __set_irq_handler(irq, handle, 1, NULL); | |
428 | + __irq_set_handler(irq, handle, 1, NULL); | |
429 | 429 | } |
430 | 430 | |
431 | 431 | void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set); |
... | ... | @@ -578,6 +578,33 @@ |
578 | 578 | static inline void set_irq_nested_thread(unsigned int irq, int nest) |
579 | 579 | { |
580 | 580 | irq_set_nested_thread(irq, nest); |
581 | +} | |
582 | +static inline void | |
583 | +set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip, | |
584 | + irq_flow_handler_t handle, const char *name) | |
585 | +{ | |
586 | + irq_set_chip_and_handler_name(irq, chip, handle, name); | |
587 | +} | |
588 | +static inline void | |
589 | +set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip, | |
590 | + irq_flow_handler_t handle) | |
591 | +{ | |
592 | + irq_set_chip_and_handler(irq, chip, handle); | |
593 | +} | |
594 | +static inline void | |
595 | +__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained, | |
596 | + const char *name) | |
597 | +{ | |
598 | + __irq_set_handler(irq, handle, is_chained, name); | |
599 | +} | |
600 | +static inline void set_irq_handler(unsigned int irq, irq_flow_handler_t handle) | |
601 | +{ | |
602 | + irq_set_handler(irq, handle); | |
603 | +} | |
604 | +static inline void | |
605 | +set_irq_chained_handler(unsigned int irq, irq_flow_handler_t handle) | |
606 | +{ | |
607 | + irq_set_chained_handler(irq, handle); | |
581 | 608 | } |
582 | 609 | #endif |
583 | 610 |
kernel/irq/chip.c
... | ... | @@ -600,7 +600,7 @@ |
600 | 600 | } |
601 | 601 | |
602 | 602 | void |
603 | -__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained, | |
603 | +__irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained, | |
604 | 604 | const char *name) |
605 | 605 | { |
606 | 606 | unsigned long flags; |
607 | 607 | |
608 | 608 | |
... | ... | @@ -635,22 +635,14 @@ |
635 | 635 | out: |
636 | 636 | irq_put_desc_busunlock(desc, flags); |
637 | 637 | } |
638 | -EXPORT_SYMBOL_GPL(__set_irq_handler); | |
638 | +EXPORT_SYMBOL_GPL(__irq_set_handler); | |
639 | 639 | |
640 | 640 | void |
641 | -set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip, | |
642 | - irq_flow_handler_t handle) | |
643 | -{ | |
644 | - irq_set_chip(irq, chip); | |
645 | - __set_irq_handler(irq, handle, 0, NULL); | |
646 | -} | |
647 | - | |
648 | -void | |
649 | -set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip, | |
641 | +irq_set_chip_and_handler_name(unsigned int irq, struct irq_chip *chip, | |
650 | 642 | irq_flow_handler_t handle, const char *name) |
651 | 643 | { |
652 | 644 | irq_set_chip(irq, chip); |
653 | - __set_irq_handler(irq, handle, 0, name); | |
645 | + __irq_set_handler(irq, handle, 0, name); | |
654 | 646 | } |
655 | 647 | |
656 | 648 | void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set) |