Skip to content

Commit df46b30

Browse files
mjchen0fabiobaltieri
authored andcommitted
drivers: spi: mcux_flexcomm: add error handling code
In spi_mcux_transfer_next_packet(), if the next transfer start fails, add calls to spi_context_cs_control() to release cs and spi_context_complete() with error code -EIO. Signed-off-by: Mike J. Chen <[email protected]>
1 parent 03684e8 commit df46b30

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/spi/spi_mcux_flexcomm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ static void spi_mcux_transfer_next_packet(const struct device *dev)
145145
status = SPI_MasterTransferNonBlocking(base, &data->handle, &transfer);
146146
if (status != kStatus_Success) {
147147
LOG_ERR("Transfer could not start");
148+
spi_context_cs_control(&data->ctx, false);
149+
spi_context_complete(&data->ctx, dev, -EIO);
148150
}
149151
}
150152

0 commit comments

Comments
 (0)