]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
spi: stm32-qspi: Use FIELD_MODIFY()
authorHans Zhang <18255117159@163.com>
Thu, 30 Apr 2026 15:54:54 +0000 (23:54 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 11 May 2026 12:05:10 +0000 (21:05 +0900)
Use FIELD_MODIFY() to remove open-coded bit manipulation.
No functional change intended.

Signed-off-by: Hans Zhang <18255117159@163.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Link: https://patch.msgid.link/20260430155456.36998-9-18255117159@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-stm32-qspi.c

index df1bbacec90a2b2d46a312a9b4cd6c1863a4a0a1..ea69fe25686f3b4a100003b5c3c27e95b4ec3ce8 100644 (file)
@@ -374,9 +374,8 @@ static int stm32_qspi_send(struct spi_device *spi, const struct spi_mem_op *op)
        int timeout, err = 0, err_poll_status = 0;
 
        cr = readl_relaxed(qspi->io_base + QSPI_CR);
-       cr &= ~CR_PRESC_MASK & ~CR_FSEL;
-       cr |= FIELD_PREP(CR_PRESC_MASK, flash->presc);
-       cr |= FIELD_PREP(CR_FSEL, flash->cs);
+       FIELD_MODIFY(CR_PRESC_MASK, &cr, flash->presc);
+       FIELD_MODIFY(CR_FSEL, &cr, flash->cs);
        writel_relaxed(cr, qspi->io_base + QSPI_CR);
 
        if (op->data.nbytes)