Skip to content

Commit fa82ec0

Browse files
decsnynashif
authored andcommitted
drivers: spi_mcux_lpspi: Remove duplicate bufsetup
This line doesn't need to be in multiple places. Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
1 parent 830c0a9 commit fa82ec0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/spi/spi_mcux_lpspi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,9 @@ static int transceive_dma(const struct device *dev, const struct spi_config *spi
487487
/* DMA is fast enough watermarks are not required */
488488
LPSPI_SetFifoWatermarks(base, 0U, 0U);
489489

490+
spi_context_buffers_setup(&data->ctx, tx_bufs, rx_bufs, 1);
491+
490492
if (!asynchronous) {
491-
spi_context_buffers_setup(&data->ctx, tx_bufs, rx_bufs, 1);
492493
spi_context_cs_control(&data->ctx, true);
493494

494495
/* Send each spi buf via DMA, updating context as DMA completes */
@@ -710,9 +711,6 @@ static int spi_mcux_transceive(const struct device *dev, const struct spi_config
710711
struct spi_mcux_data *data = dev->data;
711712

712713
if (lpspi_inst_has_dma(data)) {
713-
if (async) {
714-
spi_context_buffers_setup(&data->ctx, tx_bufs, rx_bufs, 1);
715-
}
716714
return transceive_dma(dev, spi_cfg, tx_bufs, rx_bufs, async, cb, userdata);
717715
}
718716

0 commit comments

Comments
 (0)