[PARPORT] parport_share /proc/interrupt fix


Andrea Arcangeli (arcangeli@mbox.queen.it)
Sun, 21 Dec 1997 15:41:19 +0100 (CET)


With the current parport_share irq handling, /proc/interrupt show that the
parport owner is using interrupt even if it' s polled.

Andrea[s] Arcangeli

--- linux/drivers/misc/parport_share.c 1997/12/21 14:30:32 1.1
+++ linux/drivers/misc/parport_share.c 1997/12/21 14:31:49 1.2
@@ -279,10 +279,16 @@
 
         /* Swap the IRQ handlers. */
         if (dev->port->irq != PARPORT_IRQ_NONE) {
- free_irq(dev->port->irq, pd1?pd1->private:NULL);
- request_irq(dev->port->irq, dev->irq_func ? dev->irq_func :
- parport_null_intr_func, SA_INTERRUPT, dev->name,
- dev->private);
+ if (pd1 && pd1->irq_func) {
+ free_irq(dev->port->irq,pd1->private);
+ request_irq(dev->port->irq, parport_null_intr_func,
+ SA_INTERRUPT, dev->port->name, NULL);
+ }
+ if (dev->irq_func) {
+ free_irq(dev->port->irq, NULL);
+ request_irq(dev->port->irq, dev->irq_func,
+ SA_INTERRUPT, dev->name, dev->private);
+ }
         }
 
         /* Restore control registers */
@@ -306,7 +312,7 @@
         dev->port->ops->save_state(dev->port, dev->state);
 
         /* Point IRQs somewhere harmless. */
- if (dev->port->irq != PARPORT_IRQ_NONE) {
+ if (dev->port->irq != PARPORT_IRQ_NONE && dev->irq_func) {
                 free_irq(dev->port->irq, dev->private);
                 request_irq(dev->port->irq, parport_null_intr_func,
                             SA_INTERRUPT, dev->port->name, NULL);

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Wed 30 Dec 1998 - 10:17:13 EST