| @@ -810,57 +810,6 @@ unlock: · 809 unmodified lines |
| 810 | } | 810 | } |
| 811 | EXPORT_SYMBOL_GPL(__irq_alloc_descs); | 811 | EXPORT_SYMBOL_GPL(__irq_alloc_descs); |
| 812 | | 812 | |
| 813 | #ifdef CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ | | |
| 814 | /** | | |
| 815 | * irq_alloc_hwirqs - Allocate an irq descriptor and initialize the hardware | | |
| 816 | * @cnt: number of interrupts to allocate | | |
| 817 | * @node: node on which to allocate | | |
| 818 | * | | |
| 819 | * Returns an interrupt number > 0 or 0, if the allocation fails. | | |
| 820 | */ | | |
| 821 | unsigned int irq_alloc_hwirqs(int cnt, int node) | | |
| 822 | { | | |
| 823 | int i, irq = __irq_alloc_descs(-1, 0, cnt, node, NULL, NULL); | | |
| 824 | | | |
| 825 | if (irq < 0) | | |
| 826 | return 0; | | |
| 827 | | | |
| 828 | for (i = irq; cnt > 0; i++, cnt--) { | | |
| 829 | if (arch_setup_hwirq(i, node)) | | |
| 830 | goto err; | | |
| 831 | irq_clear_status_flags(i, _IRQ_NOREQUEST); | | |
| 832 | } | | |
| 833 | return irq; | | |
| 834 | | | |
| 835 | err: | | |
| 836 | for (i--; i >= irq; i--) { | | |
| 837 | irq_set_status_flags(i, _IRQ_NOREQUEST | _IRQ_NOPROBE); | | |
| 838 | arch_teardown_hwirq(i); | | |
| 839 | } | | |
| 840 | irq_free_descs(irq, cnt); | | |
| 841 | return 0; | | |
| 842 | } | | |
| 843 | EXPORT_SYMBOL_GPL(irq_alloc_hwirqs); | | |
| 844 | | | |
| 845 | /** | | |
| 846 | * irq_free_hwirqs - Free irq descriptor and cleanup the hardware | | |
| 847 | * @from: Free from irq number | | |
| 848 | * @cnt: number of interrupts to free | | |
| 849 | * | | |
| 850 | */ | | |
| 851 | void irq_free_hwirqs(unsigned int from, int cnt) | | |
| 852 | { | | |
| 853 | int i, j; | | |
| 854 | | | |
| 855 | for (i = from, j = cnt; j > 0; i++, j--) { | | |
| 856 | irq_set_status_flags(i, _IRQ_NOREQUEST | _IRQ_NOPROBE); | | |
| 857 | arch_teardown_hwirq(i); | | |
| 858 | } | | |
| 859 | irq_free_descs(from, cnt); | | |
| 860 | } | | |
| 861 | EXPORT_SYMBOL_GPL(irq_free_hwirqs); | | |
| 862 | #endif | | |
| 863 | | | |
| 864 | /** | 813 | /** |
| 865 | * irq_get_next_irq - get next allocated irq number | 814 | * irq_get_next_irq - get next allocated irq number |
| 866 | * @offset: where to start the search | 815 | * @offset: where to start the search |