From: Frank Mori Hess Date: Fri, 28 Sep 2007 18:40:55 +0000 (+0000) Subject: Eliminated the possibility of the ao dma channel getting allocated X-Git-Tag: r0_7_75~31 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=883b4f2bf63257549f1ba3f7646d44f7bdcb1bf1;p=comedi.git Eliminated the possibility of the ao dma channel getting allocated more than once, when ni_ao_inttrig gets called a second time after returning an error. --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index fdac6580..552a4c6f 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -2813,6 +2813,11 @@ static int ni_ao_inttrig(comedi_device *dev,comedi_subdevice *s, if(trignum!=0) return -EINVAL; + /* Null trig at beginning prevent ao start trigger from executing more than + once per command (and doing things like trying to allocate the ao dma channel + multiple times) */ + s->async->inttrig = NULL; + ni_set_bits(dev, Interrupt_B_Enable_Register, AO_FIFO_Interrupt_Enable | AO_Error_Interrupt_Enable, 0); interrupt_b_bits = AO_Error_Interrupt_Enable; #ifdef PCIDMA @@ -2823,7 +2828,6 @@ static int ni_ao_inttrig(comedi_device *dev,comedi_subdevice *s, if(ret) return ret; ret = ni_ao_wait_for_dma_load(dev); if(ret < 0) return ret; - #else ret = ni_ao_prep_fifo(dev,s); if(ret==0)return -EPIPE; @@ -2855,8 +2859,6 @@ static int ni_ao_inttrig(comedi_device *dev,comedi_subdevice *s, devpriv->stc_writew(dev, devpriv->ao_cmd2|AO_START1_Pulse,AO_Command_2_Register); - s->async->inttrig=NULL; - return 0; }