Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: hd6446x: Convert to sparseirq.

Follows the se7724 change and converts the hd64461 IRQ handling to
sparseirq.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+20 -3
+1 -1
arch/sh/Kconfig
··· 731 731 config SPARSE_IRQ 732 732 def_bool y 733 733 depends on SUPERH32 && !SH_DREAMCAST && !SH_HIGHLANDER && \ 734 - !SH_RTS7751R2D && !HD64461 734 + !SH_RTS7751R2D 735 735 help 736 736 This enables support for sparse irqs. This is useful in general 737 737 as most CPUs have a fairly sparse array of IRQ vectors, which
+19 -2
arch/sh/cchips/hd6446x/hd64461.c
··· 73 73 74 74 int __init setup_hd64461(void) 75 75 { 76 - int i; 76 + int i, nid = cpu_to_node(boot_cpu_data); 77 77 78 78 if (!MACH_HD64461) 79 79 return 0; ··· 90 90 __raw_writew(0xffff, HD64461_NIMR); 91 91 92 92 /* IRQ 80 -> 95 belongs to HD64461 */ 93 - for (i = HD64461_IRQBASE; i < HD64461_IRQBASE + 16; i++) 93 + for (i = HD64461_IRQBASE; i < HD64461_IRQBASE + 16; i++) { 94 + unsigned int irq; 95 + 96 + irq = create_irq_nr(i, nid); 97 + if (unlikely(irq == 0)) { 98 + pr_err("%s: failed hooking irq %d for HD64461\n", 99 + __func__, i); 100 + return -EBUSY; 101 + } 102 + 103 + if (unlikely(irq != i)) { 104 + pr_err("%s: got irq %d but wanted %d, bailing.\n", 105 + __func__, irq, i); 106 + destroy_irq(irq); 107 + return -EINVAL; 108 + } 109 + 94 110 set_irq_chip_and_handler(i, &hd64461_irq_chip, 95 111 handle_level_irq); 112 + } 96 113 97 114 set_irq_chained_handler(CONFIG_HD64461_IRQ, hd64461_irq_demux); 98 115 set_irq_type(CONFIG_HD64461_IRQ, IRQ_TYPE_LEVEL_LOW);