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

parisc: Replace setup_irq() by request_irq()

request_irq() is preferred over setup_irq(). Invocations of setup_irq()
occur after memory allocators are ready.

Per tglx[1], setup_irq() existed in olden days when allocators were not
ready by the time early interrupts were initialized.

Hence replace setup_irq() by request_irq().

[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos

Signed-off-by: afzal mohammed <afzal.mohd.ma@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

afzal mohammed and committed by
Helge Deller
997ba657 c48b0722

+8 -22
+6 -16
arch/parisc/kernel/irq.c
··· 560 560 goto out; 561 561 } 562 562 563 - static struct irqaction timer_action = { 564 - .handler = timer_interrupt, 565 - .name = "timer", 566 - .flags = IRQF_TIMER | IRQF_PERCPU | IRQF_IRQPOLL, 567 - }; 568 - 569 - #ifdef CONFIG_SMP 570 - static struct irqaction ipi_action = { 571 - .handler = ipi_interrupt, 572 - .name = "IPI", 573 - .flags = IRQF_PERCPU, 574 - }; 575 - #endif 576 - 577 563 static void claim_cpu_irqs(void) 578 564 { 565 + unsigned long flags = IRQF_TIMER | IRQF_PERCPU | IRQF_IRQPOLL; 579 566 int i; 567 + 580 568 for (i = CPU_IRQ_BASE; i <= CPU_IRQ_MAX; i++) { 581 569 irq_set_chip_and_handler(i, &cpu_interrupt_type, 582 570 handle_percpu_irq); 583 571 } 584 572 585 573 irq_set_handler(TIMER_IRQ, handle_percpu_irq); 586 - setup_irq(TIMER_IRQ, &timer_action); 574 + if (request_irq(TIMER_IRQ, timer_interrupt, flags, "timer", NULL)) 575 + pr_err("Failed to register timer interrupt\n"); 587 576 #ifdef CONFIG_SMP 588 577 irq_set_handler(IPI_IRQ, handle_percpu_irq); 589 - setup_irq(IPI_IRQ, &ipi_action); 578 + if (request_irq(IPI_IRQ, ipi_interrupt, IRQF_PERCPU, "IPI", NULL)) 579 + pr_err("Failed to register IPI interrupt\n"); 590 580 #endif 591 581 } 592 582
+2 -6
drivers/parisc/eisa.c
··· 243 243 return IRQ_HANDLED; 244 244 } 245 245 246 - static struct irqaction irq2_action = { 247 - .handler = dummy_irq2_handler, 248 - .name = "cascade", 249 - }; 250 - 251 246 static void init_eisa_pic(void) 252 247 { 253 248 unsigned long flags; ··· 330 335 } 331 336 332 337 /* Reserve IRQ2 */ 333 - setup_irq(2, &irq2_action); 338 + if (request_irq(2, dummy_irq2_handler, 0, "cascade", NULL)) 339 + pr_err("Failed to request irq 2 (cascade)\n"); 334 340 for (i = 0; i < 16; i++) { 335 341 irq_set_chip_and_handler(i, &eisa_interrupt_type, 336 342 handle_simple_irq);