void do_become_nonbusy(comedi_device *dev,comedi_subdevice *s)
{
comedi_async *async = s->async;
- /* we do this because it's useful for the non-standard cases */
- s->subdev_flags &= ~SDF_RUNNING;
+ s->subdev_flags &= ~SDF_RUNNING;
#ifdef CONFIG_COMEDI_RT
if(s->runflags&SRF_RT){
comedi_switch_to_non_rt(dev);
s->runflags &= ~SRF_RT;
}
#endif
-
+ if(s->busy)
+ {
+ if(s->cmd_cleanup)
+ {
+ (*s->cmd_cleanup)(dev, s);
+ }
+ }
if(async){
comedi_reset_async_buf( async );
}else{
s->runflags &= ~SRF_RT;
comedi_switch_to_non_rt(dev);
}
-
+ // XXX cmd_cleanup() doesn't really belong here, but comedi_cancel() is the closest thing to
+ // do_become_nonbusy() in kcomedilib.
+ if(s->cmd_cleanup) s->cmd_cleanup(dev, s);
s->busy=NULL;
return 0;
int (*do_cmd)(comedi_device *,comedi_subdevice *);
int (*do_cmdtest)(comedi_device *,comedi_subdevice *,comedi_cmd *);
+ void (*cmd_cleanup)(comedi_device *, comedi_subdevice *);
int (*poll)(comedi_device *,comedi_subdevice *);
int (*cancel)(comedi_device *,comedi_subdevice *);
//int (*do_lock)(comedi_device *,comedi_subdevice *);