spi: introduce master->handle_err() callback

This callback would be useful to handle an error that occurs in the generic
implementation of transfer_one_message(). The good candidate for this is to
drain FIFO and / or to terminate DMA transfers when timeout happened.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Andy Shevchenko
2015-02-27 17:34:15 +02:00
committed by Mark Brown
parent c517d838eb
commit b716c4ffc6
2 changed files with 7 additions and 0 deletions

View File

@@ -851,6 +851,9 @@ out:
if (msg->status == -EINPROGRESS)
msg->status = ret;
if (msg->status)
master->handle_err(master, msg);
spi_finalize_current_message(master);
return ret;