From aa9cfc818cadeae2bd2f99799f7a3abb90d38ba1 Mon Sep 17 00:00:00 2001 From: Marta Momotko Date: Tue, 30 Jun 2026 16:55:35 +0100 Subject: [PATCH] spi: dw: Fix duplicate condition check in transfer_one The transmit only and receive only conditions in dw_spi_transfer_one() are mutually exclusive, so restructure as if/else if and remove the duplicate check. Signed-off-by: Marta Momotko --- drivers/spi/spi-dw-core.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index b73aea4c253579..bb6989b4b61855 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi-dw-core.c @@ -503,13 +503,7 @@ static int dw_spi_transfer_one(struct spi_controller *host, if (!dws->rx) { dws->rx_len = 0; cfg.tmode = DW_SPI_CTRLR0_TMOD_TO; - } - - if (!dws->rx) { - dws->rx_len = 0; - cfg.tmode = DW_SPI_CTRLR0_TMOD_TO; - } - if (!dws->tx) { + } else if (!dws->tx) { dws->tx_len = 0; cfg.tmode = DW_SPI_CTRLR0_TMOD_RO; cfg.ndf = dws->rx_len;