uru4000: Call irq stop handler immediately if the transfer is cancelled

The irq handler may already be stopped if stop_irq_handler is called. In
that case, we should immediately call the handler rather than just never
calling it.

This fixes deactivation when the device is unexpectedly unplugged.

Closes: #355
This commit is contained in:
Benjamin Berg 2021-01-25 11:26:58 +01:00 committed by Marco Trevisan
parent 3693c39bc5
commit 08f4be707c

View file

@ -375,6 +375,10 @@ stop_irq_handler (FpImageDevice *dev, irqs_stopped_cb_fn cb)
g_cancellable_cancel (self->irq_cancellable);
self->irqs_stopped_cb = cb;
}
else
{
cb (dev);
}
}
/***** STATE CHANGING *****/