Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 215ecf8a authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: hwdrv_apci3120: do comedi_handle_events() at end of interrupt



Currently comedi_handle_events() is done by both the DMA and non-DMA helper
functions that are called by the interrupt handler. For aesthetics, move
the comedi_handle_events() to the end of the interrupt handler and do it in
one place.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ff6f21a5
Loading
Loading
Loading
Loading
+2 −8
Original line number Original line Diff line number Diff line
@@ -1327,16 +1327,13 @@ static void apci3120_interrupt_dma(int irq, void *d)
			devpriv->ul_DmaBufferVirtual[devpriv->
			devpriv->ul_DmaBufferVirtual[devpriv->
				ui_DmaActualBuffer], samplesinbuf);
				ui_DmaActualBuffer], samplesinbuf);


		if (!(cmd->flags & CMDF_WAKE_EOS)) {
		if (!(cmd->flags & CMDF_WAKE_EOS))
			s->async->events |= COMEDI_CB_EOS;
			s->async->events |= COMEDI_CB_EOS;
			comedi_handle_events(dev, s);
		}
	}
	}
	if (cmd->stop_src == TRIG_COUNT)
	if (cmd->stop_src == TRIG_COUNT)
		if (devpriv->ui_AiActualScan >= cmd->stop_arg) {
		if (devpriv->ui_AiActualScan >= cmd->stop_arg) {
			/*  all data sampled */
			/*  all data sampled */
			s->async->events |= COMEDI_CB_EOA;
			s->async->events |= COMEDI_CB_EOA;
			comedi_handle_events(dev, s);
			return;
			return;
		}
		}


@@ -1415,8 +1412,6 @@ static int apci3120_interrupt_handle_eos(struct comedi_device *dev)
	if (err == 0)
	if (err == 0)
		s->async->events |= COMEDI_CB_OVERFLOW;
		s->async->events |= COMEDI_CB_OVERFLOW;


	comedi_handle_events(dev, s);

	return 0;
	return 0;
}
}


@@ -1539,8 +1534,6 @@ static void apci3120_interrupt(int irq, void *d)
				dev->iobase + APCI3120_WR_ADDRESS);
				dev->iobase + APCI3120_WR_ADDRESS);


			s->async->events |= COMEDI_CB_EOA;
			s->async->events |= COMEDI_CB_EOA;
			comedi_handle_events(dev, s);

			break;
			break;


		case APCI3120_TIMER:
		case APCI3120_TIMER:
@@ -1593,6 +1586,7 @@ static void apci3120_interrupt(int irq, void *d)
		}
		}


	}
	}
	comedi_handle_events(dev, s);
}
}


/*
/*