[PATCH v5 2/4] spi: Release spi_res after finalizing message

Noralf Trønnes noralf at tronnes.org
Sat Apr 13 18:24:13 UTC 2019


spi_split_transfers_maxsize() can be used to split a transfer. This
function uses spi_res to lifetime manage the added transfer structures.
So in order to finalize the current message while it contains the split
transfers, spi_res_release() must be called after finalizing.

Signed-off-by: Noralf Trønnes <noralf at tronnes.org>
---
 drivers/spi/spi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 05875e63be43..35939ffdeebe 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1162,10 +1162,10 @@ static int spi_transfer_one_message(struct spi_controller *ctlr,
 	if (msg->status && ctlr->handle_err)
 		ctlr->handle_err(ctlr, msg);
 
-	spi_res_release(ctlr, msg);
-
 	spi_finalize_current_message(ctlr);
 
+	spi_res_release(ctlr, msg);
+
 	return ret;
 }
 
-- 
2.20.1



More information about the dri-devel mailing list