patch-2.1.126 linux/drivers/misc/parport_pc.c

Next file: linux/drivers/misc/parport_procfs.c
Previous file: linux/drivers/misc/parport_ax.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.125/linux/drivers/misc/parport_pc.c linux/drivers/misc/parport_pc.c
@@ -1,4 +1,4 @@
-/* Low-level parallel-port routines for PC-style hardware.
+/* Low-level parallel-port routines for 8255-based PC-style hardware.
  * 
  * Authors: Phil Blundell <Philip.Blundell@pobox.com>
  *          Tim Waugh <tim@cyberelk.demon.co.uk>
@@ -32,13 +32,8 @@
  * accomodate this.
  */
 
-#include <linux/stddef.h>
-#include <linux/tasks.h>
-
-#include <asm/ptrace.h>
-#include <asm/io.h>
-
 #include <linux/module.h>
+#include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
@@ -46,6 +41,8 @@
 #include <linux/kernel.h>
 #include <linux/malloc.h>
 
+#include <asm/io.h>
+
 #include <linux/parport.h>
 #include <linux/parport_pc.h>
 
@@ -53,9 +50,9 @@
    than PARPORT_MAX (in <linux/parport.h>).  */
 #define PARPORT_PC_MAX_PORTS  8
 
-static void parport_pc_null_intr_func(int irq, void *dev_id, struct pt_regs *regs)
+static void parport_pc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	/* Null function - does nothing */
+	parport_generic_irq(irq, (struct parport *) dev_id, regs);
 }
 
 void parport_pc_write_epp(struct parport *p, unsigned char d)
@@ -173,7 +170,7 @@
 void parport_pc_release_resources(struct parport *p)
 {
 	if (p->irq != PARPORT_IRQ_NONE)
-		free_irq(p->irq, NULL);
+		free_irq(p->irq, p);
 	release_region(p->base, p->size);
 	if (p->modes & PARPORT_MODE_PCECR)
 		release_region(p->base+0x400, 3);
@@ -183,7 +180,9 @@
 {
 	int err;
 	if (p->irq != PARPORT_IRQ_NONE)
-		if ((err = request_irq(p->irq, parport_pc_null_intr_func, 0, p->name, NULL)) != 0) return err;
+		if ((err = request_irq(p->irq, parport_pc_interrupt,
+				       0, p->name, p)) != 0)
+			return err;
 	request_region(p->base, p->size, p->name);
 	if (p->modes & PARPORT_MODE_PCECR)
 		request_region(p->base+0x400, 3, p->name);
@@ -242,11 +241,6 @@
 	return -ENOSYS; /* FIXME */
 }
 
-int parport_pc_examine_irq(struct parport *p)
-{
-	return 0; /* FIXME */
-}
-
 void parport_pc_inc_use_count(void)
 {
 #ifdef MODULE
@@ -313,7 +307,7 @@
 
 	parport_pc_enable_irq,
 	parport_pc_disable_irq,
-	parport_pc_examine_irq,
+	parport_pc_interrupt,
 
 	parport_pc_inc_use_count,
 	parport_pc_dec_use_count,

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov