fixed problem with comedi_switch_to_rt() and irq-less comedi_rt_timer driver
authorFrank Mori Hess <fmhess@speakeasy.net>
Sat, 19 May 2001 20:46:29 +0000 (20:46 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Sat, 19 May 2001 20:46:29 +0000 (20:46 +0000)
comedi/drivers/comedi_rt_timer.c
comedi/rt.c

index 97c6ebf603c27fca6fe24a5a6de83d99d8eefb3f..dcd57d2753c13d29ab5c0743c507faec88180bbd 100644 (file)
@@ -32,7 +32,6 @@ TODO:
        Support for digital io commands could be added, except I can't see why
                anyone would want to use them
        What happens if device we are emulating for is de-configured?
-       Make it work from kernel space (fix problems with comedi_switch_to_rt() etc.)
 
 */
 
@@ -355,14 +354,6 @@ static int timer_cmdtest(comedi_device *dev,comedi_subdevice *s,comedi_cmd *cmd)
 
        /* step 4: fix up and arguments */
 
-       /* TRIG_RT flag will cause a null dereference, since this is a weird driver
-        * so zero it! */
-       if(cmd->flags & TRIG_RT)
-       {
-               cmd->flags &= ~TRIG_RT;
-               err++;
-       }
-
        if(err)return 4;
 
        return 0;
index 4792c31b3183d4c170a22274f346cb18cc23f23e..85fd0ae8a54482222bce260c6c8c9c55b7145ae1 100644 (file)
@@ -127,6 +127,9 @@ void comedi_switch_to_rt(comedi_device *dev)
 {
        struct comedi_irq_struct *it=comedi_irqs[dev->irq];
 
+       if(it == NULL)
+               return;
+
        spin_lock_irq(&dev->spinlock);
        RT_protect();
        sti();
@@ -144,6 +147,9 @@ void comedi_switch_to_non_rt(comedi_device *dev)
 {
        struct comedi_irq_struct *it=comedi_irqs[dev->irq];
 
+       if(it == NULL)
+               return;
+
        RT_spin_lock_irq(&dev->spinlock);
 
        dev->rt--;