Check the position of ForceStop and Trigger events only in case we
are in CAPTURE state, it's useless to do this unconditionally when
receive_data() is called.
Signed-off-by: Marek Vasut <redacted>
sdi = cb_data;
devc = sdi->priv;
- /* Get the current position. */
- sigma_read_pos(&devc->state.stoppos, &devc->state.triggerpos, devc);
-
if (devc->state.state == SIGMA_IDLE)
return TRUE;
if (devc->state.state == SIGMA_CAPTURE) {
+ /* Get the current position. */
+ sigma_read_pos(&devc->state.stoppos, &devc->state.triggerpos,
+ devc);
+
numchunks = (devc->state.stoppos + 511) / 512;
/* Check if the timer has expired, or memory is full. */