1.3.70 and irq

Alberto Vignani (alberto.vignani@torino.alpcom.it)
Mon, 04 Mar 1996 23:08:18 +0000 (GMT)


Hello.

Since my message of 3/1/96 seems to have never reached the list, and people
begin to send patches concerning the extra parameter to add to request_irq()
and free_irq(), I want just to point out that something else has changed
too: there is an extra second parameter in the irq handler.

e.g. look at /linux/arch/i386/kernel/irq.c 297:

action->handler(irq, action->dev_id, regs);
action = action->next;
}

and later

action->handler(irq, action->dev_id, NULL);
action = action->next;
}

The extra second parameter produces only a warning from the compiler and
can go unnoticed. The kernel should be fixed by now, but some extra modules
(e.g. ftape and emumodule) are not.
Currently this extra parameter should do no harm ('regs' was unused in the
modules I saw), but who knows.

Here are my diffs against ftape-2.0.6:

============================================================================
diff -buHr ftape-2.06/fdc-io.c ftape/fdc-io.c
--- ftape-2.06/fdc-io.c Sun Jan 28 15:42:04 1996
+++ ftape/fdc-io.c Fri Mar 1 22:11:08 1996
@@ -1202,7 +1202,7 @@
TRACE_EXIT;
}

-static void ftape_interrupt( int irq, struct pt_regs* regs)
+static void ftape_interrupt( int irq, void *dev_id, struct pt_regs* regs)
{
TRACE_FUN( 8, "ftape_interrupt");
void (*handler)(void) = *fdc.hook;
@@ -1226,7 +1226,7 @@
if (fdc.hook == &do_ftape) {
/* Get fast interrupt handler.
*/
- result = request_irq( fdc.irq, ftape_interrupt, SA_INTERRUPT, ftape_id);
+ result = request_irq( fdc.irq, ftape_interrupt, SA_INTERRUPT, ftape_id, NULL);
if (result) {
TRACEx1( -1, "Unable to grab IRQ%d for ftape driver", fdc.irq);
result = -EIO;
@@ -1234,7 +1234,7 @@
result = request_dma( fdc.dma, ftape_id);
if (result) {
TRACEx1( -1, "Unable to grab DMA%d for ftape driver", fdc.dma);
- free_irq( fdc.irq);
+ free_irq( fdc.irq, NULL);
result = -EIO;
} else {
enable_irq( fdc.irq);
@@ -1266,7 +1266,7 @@
disable_dma( fdc.dma); /* just in case... */
free_dma( fdc.dma);
disable_irq( fdc.irq);
- free_irq( fdc.irq);
+ free_irq( fdc.irq, NULL);
}
#ifdef FDC_DMA
if (result == 0 && FDC_DMA == 2) {
============================================================================

The same should be valid for dosemu/.../emumod/emusys.c: add 'void *dev_id'
as the second parameter of 'static void irq_handler()'.

I haven't checked other modules. Please do ASAP.

Alberto