mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
spi: sunplus-sp7021: Use FIELD_MODIFY()
Use FIELD_MODIFY() to remove open-coded bit manipulation. No functional change intended. Signed-off-by: Hans Zhang <18255117159@163.com> Link: https://patch.msgid.link/20260430155456.36998-10-18255117159@163.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -290,8 +290,7 @@ static void sp7021_spi_setup_clk(struct spi_controller *ctlr, struct spi_transfe
|
||||
div = max(2U, clk_rate / xfer->speed_hz);
|
||||
|
||||
clk_sel = (div / 2) - 1;
|
||||
pspim->xfer_conf &= ~SP7021_CLK_MASK;
|
||||
pspim->xfer_conf |= FIELD_PREP(SP7021_CLK_MASK, clk_sel);
|
||||
FIELD_MODIFY(SP7021_CLK_MASK, &pspim->xfer_conf, clk_sel);
|
||||
writel(pspim->xfer_conf, pspim->m_base + SP7021_SPI_CONFIG_REG);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user