From: David Schleef Date: Thu, 16 May 2002 22:37:02 +0000 (+0000) Subject: Change inttrig error handling. Fix spelling errors. X-Git-Tag: r0_7_65~32 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5c2ddb264f487eb4d6c06b9cd305d4d08d139e9d;p=comedi.git Change inttrig error handling. Fix spelling errors. --- diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 883e6801..033945f5 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -612,22 +612,33 @@ static int parse_insn(comedi_device *dev,comedi_insn *insn,lsampl_t *data,void * ret=1; break; case INSN_INTTRIG: + if(insn->n!=1){ + ret=-EINVAL; + break; + } if(insn->subdev>=dev->n_subdevices){ - DPRINTK("%d not useable subdevice\n",insn->subdev); + DPRINTK("%d not usable subdevice\n",insn->subdev); ret=-EINVAL; break; } s=dev->subdevices+insn->subdev; - if(!s->async || !s->async->inttrig){ - DPRINTK("no async or no inttrig\n"); + if(!s->async){ + DPRINTK("no async\n"); ret=-EINVAL; break; } - ret = s->async->inttrig(dev,s,0); + if(!s->async->inttrig){ + DPRINTK("no inttrig\n"); + ret=-EAGAIN; + break; + } + ret = s->async->inttrig(dev,s,insn->data[0]); + if(ret>=0)ret = 1; break; default: DPRINTK("invalid insn\n"); ret=-EINVAL; + break; } }else{ /* a subdevice instruction */ @@ -638,7 +649,7 @@ static int parse_insn(comedi_device *dev,comedi_insn *insn,lsampl_t *data,void * s=dev->subdevices+insn->subdev; if(s->type==COMEDI_SUBD_UNUSED){ - DPRINTK("%d not useable subdevice\n",insn->subdev); + DPRINTK("%d not usable subdevice\n",insn->subdev); ret = -EIO; goto out; }