From: H Hartley Sweeten Date: Mon, 5 May 2014 16:48:17 +0000 (-0700) Subject: staging: comedi: adl_pc19111: remove 'stop_is_none' from private data X-Git-Tag: v4.14-rc1~7083^2~39^2~481 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b978052b600c4ea00b445986680629c2867ea311;p=platform%2Fkernel%2Flinux-rpi.git staging: comedi: adl_pc19111: remove 'stop_is_none' from private data This member of the private data can be determined by checking the cmd->stop_src. Do that instead. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c index 96b1bf8..430b51a 100644 --- a/drivers/staging/comedi/drivers/adl_pci9111.c +++ b/drivers/staging/comedi/drivers/adl_pci9111.c @@ -137,7 +137,6 @@ struct pci9111_private_data { unsigned long lcr_io_base; int stop_counter; - int stop_is_none; unsigned int scan_delay; unsigned int chanlist_len; @@ -485,10 +484,8 @@ static int pci9111_ai_do_cmd(struct comedi_device *dev, if (async_cmd->stop_src == TRIG_COUNT) { dev_private->stop_counter = async_cmd->stop_arg * async_cmd->chanlist_len; - dev_private->stop_is_none = 0; } else { /* TRIG_NONE */ dev_private->stop_counter = 0; - dev_private->stop_is_none = 1; } /* Set timer pacer */ @@ -550,6 +547,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device) struct pci9111_private_data *dev_private = dev->private; struct comedi_subdevice *s = dev->read_subdev; struct comedi_async *async; + struct comedi_cmd *cmd; unsigned int status; unsigned long irq_flags; unsigned char intcsr; @@ -561,6 +559,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device) } async = s->async; + cmd = &async->cmd; spin_lock_irqsave(&dev->spinlock, irq_flags); @@ -596,12 +595,11 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device) unsigned int num_samples; unsigned int bytes_written = 0; - num_samples = - PCI9111_FIFO_HALF_SIZE > - dev_private->stop_counter - && !dev_private-> - stop_is_none ? dev_private->stop_counter : - PCI9111_FIFO_HALF_SIZE; + if (cmd->stop_src == TRIG_COUNT && + PCI9111_FIFO_HALF_SIZE > dev_private->stop_counter) + num_samples = dev_private->stop_counter; + else + num_samples = PCI9111_FIFO_HALF_SIZE; insw(dev->iobase + PCI9111_AI_FIFO_REG, dev_private->ai_bounce_buffer, num_samples); @@ -664,7 +662,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device) } } - if (dev_private->stop_counter == 0 && !dev_private->stop_is_none) + if (cmd->stop_src == TRIG_COUNT && dev_private->stop_counter == 0) async->events |= COMEDI_CB_EOA; outb(0, dev->iobase + PCI9111_INT_CLR_REG);