mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
spi: stm32-qspi: Use FIELD_MODIFY()
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>
This commit is contained in:
parent
21ee6902a5
commit
3e0530c087
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user