ARM: 8965/2: footbridge: replace setup_irq() by request_irq()
authorafzal mohammed <afzal.mohd.ma@gmail.com>
Thu, 12 Mar 2020 13:51:23 +0000 (14:51 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Thu, 19 Mar 2020 09:27:40 +0000 (09:27 +0000)
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: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/mach-footbridge/dc21285-timer.c
arch/arm/mach-footbridge/isa-irq.c
arch/arm/mach-footbridge/isa-timer.c

index f76212d..2908c9e 100644 (file)
@@ -101,13 +101,6 @@ static irqreturn_t timer1_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static struct irqaction footbridge_timer_irq = {
-       .name           = "dc21285_timer1",
-       .handler        = timer1_interrupt,
-       .flags          = IRQF_TIMER | IRQF_IRQPOLL,
-       .dev_id         = &ckevt_dc21285,
-};
-
 /*
  * Set up timer interrupt.
  */
@@ -118,7 +111,9 @@ void __init footbridge_timer_init(void)
 
        clocksource_register_hz(&cksrc_dc21285, rate);
 
-       setup_irq(ce->irq, &footbridge_timer_irq);
+       if (request_irq(ce->irq, timer1_interrupt, IRQF_TIMER | IRQF_IRQPOLL,
+                       "dc21285_timer1", &ckevt_dc21285))
+               pr_err("Failed to request irq %d (dc21285_timer1)", ce->irq);
 
        ce->cpumask = cpumask_of(smp_processor_id());
        clockevents_config_and_register(ce, rate, 0x4, 0xffffff);
index 88a5539..842ddb4 100644 (file)
@@ -96,11 +96,6 @@ static void isa_irq_handler(struct irq_desc *desc)
        generic_handle_irq(isa_irq);
 }
 
-static struct irqaction irq_cascade = {
-       .handler = no_action,
-       .name = "cascade",
-};
-
 static struct resource pic1_resource = {
        .name   = "pic1",
        .start  = 0x20,
@@ -160,7 +155,10 @@ void __init isa_init_irq(unsigned int host_irq)
 
                request_resource(&ioport_resource, &pic1_resource);
                request_resource(&ioport_resource, &pic2_resource);
-               setup_irq(IRQ_ISA_CASCADE, &irq_cascade);
+
+               irq = IRQ_ISA_CASCADE;
+               if (request_irq(irq, no_action, 0, "cascade", NULL))
+                       pr_err("Failed to request irq %u (cascade)\n", irq);
 
                irq_set_chained_handler(host_irq, isa_irq_handler);
 
index 82f4559..723e3ea 100644 (file)
@@ -25,17 +25,12 @@ static irqreturn_t pit_timer_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static struct irqaction pit_timer_irq = {
-       .name           = "pit",
-       .handler        = pit_timer_interrupt,
-       .flags          = IRQF_TIMER | IRQF_IRQPOLL,
-       .dev_id         = &i8253_clockevent,
-};
-
 void __init isa_timer_init(void)
 {
        clocksource_i8253_init();
 
-       setup_irq(i8253_clockevent.irq, &pit_timer_irq);
+       if (request_irq(i8253_clockevent.irq, pit_timer_interrupt,
+                       IRQF_TIMER | IRQF_IRQPOLL, "pit", &i8253_clockevent))
+               pr_err("Failed to request irq %d(pit)\n", i8253_clockevent.irq);
        clockevent_i8253_init(false);
 }