Skip to content

Commit aac733a

Browse files
miquelraynalbroonie
authored andcommitted
spi: cadence-qspi: Fix style and improve readability
It took me several seconds to correctly understand this block. I understand the goal: showing that we are in the if, or in one of the two other cases. Improve the organization of the code to both improve readability and fix the style. Suggested-by: Pratyush Yadav <pratyush@kernel.org> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com> Tested-by: Santhosh Kumar K <s-k6@ti.com> Link: https://patch.msgid.link/20260122-schneider-6-19-rc1-qspi-v4-4-f9c21419a3e6@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 9dfc9c1 commit aac733a

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

drivers/spi/spi-cadence-quadspi.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -374,17 +374,12 @@ static irqreturn_t cqspi_irq_handler(int this_irq, void *dev)
374374
/* Clear interrupt */
375375
writel(irq_status, cqspi->iobase + CQSPI_REG_IRQSTATUS);
376376

377-
if (cqspi->use_dma_read && ddata && ddata->get_dma_status) {
378-
if (ddata->get_dma_status(cqspi)) {
379-
complete(&cqspi->transfer_complete);
380-
return IRQ_HANDLED;
381-
}
382-
}
383-
384-
else if (!cqspi->slow_sram)
385-
irq_status &= CQSPI_IRQ_MASK_RD | CQSPI_IRQ_MASK_WR;
386-
else
377+
if (cqspi->use_dma_read && ddata && ddata->get_dma_status)
378+
irq_status = ddata->get_dma_status(cqspi);
379+
else if (cqspi->slow_sram)
387380
irq_status &= CQSPI_IRQ_MASK_RD_SLOW_SRAM | CQSPI_IRQ_MASK_WR;
381+
else
382+
irq_status &= CQSPI_IRQ_MASK_RD | CQSPI_IRQ_MASK_WR;
388383

389384
if (irq_status)
390385
complete(&cqspi->transfer_complete);

0 commit comments

Comments
 (0)