[PATCH 08/10] spi: stm32-qspi: Use FIELD_MODIFY()
Patrice CHOTARD
patrice.chotard at foss.st.com
Mon May 11 00:59:06 PDT 2026
On 4/30/26 17:54, Hans Zhang wrote:
> Use FIELD_MODIFY() to remove open-coded bit manipulation.
> No functional change intended.
>
> Signed-off-by: Hans Zhang <18255117159 at 163.com>
> ---
> drivers/spi/spi-stm32-qspi.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c
> index df1bbacec90a..ea69fe25686f 100644
> --- a/drivers/spi/spi-stm32-qspi.c
> +++ b/drivers/spi/spi-stm32-qspi.c
> @@ -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)
Hi Hans
Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>
Thanks
Patrice
More information about the linux-amlogic
mailing list