On Tue, Oct 08, 2013 at 11:48:39AM +0200, Markus Pargmann wrote:
On Tue, Oct 08, 2013 at 10:34:13AM +0100, Mark Brown wrote:
I meant just unwinding the things done in the trigger call.
You mean unwinding when we detect the error? If we return the error code from the trigger function, the pcm_native.c will still trigger a STOP command which is executed on all components.
Sure, but it's another way of getting consistency and does seem a bit more obvious.
Another possibility is to explicitly allow multiple _STOPs. Then I could fix the driver to store the clock state. But I would prefer a generic solution.
You're going to have to handle this anyway to be robust - what happens if it's the clock enable that fails?
If clk_enable fails, we can return an error code in the mxs-saif trigger function. Of course the error handling is missing here, but it is not necessary to store the state of the clock to handle errors properly.
Right, but then _STOP will be called without the clock having been successfully enabled so you'll have an unbalanced clk_disable().