* Trying to free IRQ
@ 2008-10-17 8:15 Juan Antonio Medina Guerrero
2008-10-17 9:00 ` selvamuthukumar v
0 siblings, 1 reply; 2+ messages in thread
From: Juan Antonio Medina Guerrero @ 2008-10-17 8:15 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 1602 bytes --]
Hello,
We are trying to implement an interrupt. The interrupt run ok but if we want
to unload and reload the module our system crashes:
Exit module output:
<3>Trying to free already-free IRQ 71
Init module output:
<3>IRQ handler type mismatch for IRQ 71
current handler: MYMODULE
This is part of the code:
Dts:
mydev@8030 {
device_type = "mydev";
compatible = "mymodule";
reg = <8030 300>;
interrupts = <47 8>;
interrupt-parent = <700>;
};
Global variable:
unsigned int dev_id=MKDEV(MYDEV_MAJOR,0);
struct device_node* dev_node;
int irq_id;
Init_module:
// Find device node in device tree
dev_node = of_find_node_by_type(NULL, "mydev");
if (!dev_node)
{
printk(KERN_ALERT "\n\tERROR: No device found in device
tree\n");
goto init_find_node_error;
}
// Get and map irq number from device tree
irq_id = irq_of_parse_and_map(dev_node, 0);
if (irq_id == NO_IRQ)
{
printk(KERN_ALERT "\n\tERROR: irq_of_parse_and_map failed\n");
goto init_parse_map_irq_error;
}
// Request irq
if (request_irq(irq_id, interrupt_handler, 0, "MYMODULE", &dev_id))
{
printk (KERN_ALERT "\n\tERROR: request irq\n");
goto init_request_irq_error;
}
Exit_module:
free_irq(irq_id,NULL);
of_node_put(dev_node);
Could you please help us with this?
Regards,
Medina
[-- Attachment #2: Type: text/html, Size: 16251 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Trying to free IRQ
2008-10-17 8:15 Trying to free IRQ Juan Antonio Medina Guerrero
@ 2008-10-17 9:00 ` selvamuthukumar v
0 siblings, 0 replies; 2+ messages in thread
From: selvamuthukumar v @ 2008-10-17 9:00 UTC (permalink / raw)
To: Juan Antonio Medina Guerrero; +Cc: linuxppc-embedded
On Fri, Oct 17, 2008 at 1:45 PM, Juan Antonio Medina Guerrero
<juan-antonio.medina@anafocus.com> wrote:
> if (request_irq(irq_id, interrupt_handler, 0, "MYMODULE", &dev_id))
<snip>
> free_irq(irq_id,NULL);
>
This should be free_irq(irq_id, &dev_id);
--
Selva
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-17 9:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-17 8:15 Trying to free IRQ Juan Antonio Medina Guerrero
2008-10-17 9:00 ` selvamuthukumar v
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).