mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
![afzal mohammed](/assets/img/avatar_default.png)
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(). remove_irq() has been replaced by free_irq() as well. There were build error's during previous version, couple of which was reported by kbuild test robot <lkp@intel.com> of which one was reported by Thomas Bogendoerfer <tsbogend@alpha.franken.de> as well. There were a few more issues including build errors, those also have been fixed. [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: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
76 lines
1.5 KiB
C
76 lines
1.5 KiB
C
/*
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
* for more details.
|
|
*
|
|
* Copyright (C) 1992 Linus Torvalds
|
|
* Copyright (C) 1994 - 2000 Ralf Baechle
|
|
* Copyright (C) 2006 Thomas Bogendoerfer
|
|
*/
|
|
#include <linux/delay.h>
|
|
#include <linux/init.h>
|
|
#include <linux/interrupt.h>
|
|
#include <linux/irq.h>
|
|
#include <linux/kernel.h>
|
|
|
|
#include <asm/i8259.h>
|
|
#include <asm/io.h>
|
|
#include <asm/sni.h>
|
|
#include <asm/irq.h>
|
|
#include <asm/irq_cpu.h>
|
|
|
|
void (*sni_hwint)(void);
|
|
|
|
asmlinkage void plat_irq_dispatch(void)
|
|
{
|
|
sni_hwint();
|
|
}
|
|
|
|
/* ISA irq handler */
|
|
irqreturn_t sni_isa_irq_handler(int dummy, void *p)
|
|
{
|
|
int irq;
|
|
|
|
irq = i8259_irq();
|
|
if (unlikely(irq < 0))
|
|
return IRQ_NONE;
|
|
|
|
generic_handle_irq(irq);
|
|
return IRQ_HANDLED;
|
|
}
|
|
|
|
/*
|
|
* On systems with i8259-style interrupt controllers we assume for
|
|
* driver compatibility reasons interrupts 0 - 15 to be the i8295
|
|
* interrupts even if the hardware uses a different interrupt numbering.
|
|
*/
|
|
void __init arch_init_irq(void)
|
|
{
|
|
init_i8259_irqs(); /* Integrated i8259 */
|
|
switch (sni_brd_type) {
|
|
case SNI_BRD_10:
|
|
case SNI_BRD_10NEW:
|
|
case SNI_BRD_TOWER_OASIC:
|
|
case SNI_BRD_MINITOWER:
|
|
sni_a20r_irq_init();
|
|
break;
|
|
|
|
case SNI_BRD_PCI_TOWER:
|
|
sni_pcit_irq_init();
|
|
break;
|
|
|
|
case SNI_BRD_PCI_TOWER_CPLUS:
|
|
sni_pcit_cplus_irq_init();
|
|
break;
|
|
|
|
case SNI_BRD_RM200:
|
|
sni_rm200_irq_init();
|
|
break;
|
|
|
|
case SNI_BRD_PCI_MTOWER:
|
|
case SNI_BRD_PCI_DESKTOP:
|
|
case SNI_BRD_PCI_MTOWER_CPLUS:
|
|
sni_pcimt_irq_init();
|
|
break;
|
|
}
|
|
}
|