You are on page 1of 1

#define MODULE

#define __KERNEL__
#include<linux/kernel.h>
#include<linux/module.h>
#include<linux/fs.h>
#include<linux/sched.h>
char driver_name[]="praveen_irq";
struct file_operations fops;
int r,irq_no=12;
int dev_id=1;
void ISR(int irq_no,void *dev_id,struct pt_regs *r)
{
printk("ISR has raised \n");
}
int hello(void)
{
r=request_irq(irq_no,ISR,SA_SHIRQ,driver_name,&dev_id);
if(r==0)
printk("irq:success\n");
else
printk("irq fails \n");
return 0;
}
void helloexit(void)
{
printk("unloading module\n");
free_irq(irq_no,&dev_id);
}
module_init(hello);
module_exit(helloexit);

You might also like