From: Frank Mori Hess Date: Sat, 19 May 2001 20:46:29 +0000 (+0000) Subject: fixed problem with comedi_switch_to_rt() and irq-less comedi_rt_timer driver X-Git-Tag: r0_7_59~33 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1c9d8a4cfb901f5a9d145915b2949d4726b57944;p=comedi.git fixed problem with comedi_switch_to_rt() and irq-less comedi_rt_timer driver --- diff --git a/comedi/drivers/comedi_rt_timer.c b/comedi/drivers/comedi_rt_timer.c index 97c6ebf6..dcd57d27 100644 --- a/comedi/drivers/comedi_rt_timer.c +++ b/comedi/drivers/comedi_rt_timer.c @@ -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; diff --git a/comedi/rt.c b/comedi/rt.c index 4792c31b..85fd0ae8 100644 --- a/comedi/rt.c +++ b/comedi/rt.c @@ -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--;