[PATCH 03/10] spi: cadence-xspi: Use FIELD_MODIFY()

Mark Brown broonie at kernel.org
Thu Apr 30 17:52:42 PDT 2026


On Thu, Apr 30, 2026 at 11:54:49PM +0800, Hans Zhang wrote:
>  		writel(clk_reg,
>  		       cdns_xspi->auxbase + MRVL_XSPI_CLK_CTRL_AUX_REG);
>  		clk_reg = FIELD_PREP(MRVL_XSPI_CLK_DIV, i);
> -		clk_reg &= ~MRVL_XSPI_CLK_DIV;
> -		clk_reg |= FIELD_PREP(MRVL_XSPI_CLK_DIV, i);
> +		FIELD_MODIFY(MRVL_XSPI_CLK_DIV, &clk_reg, i);
>  		clk_reg |= MRVL_XSPI_CLK_ENABLE;
>  		clk_reg |= MRVL_XSPI_IRQ_ENABLE;
>  		update_clk = true;

The existing code is a bit weird here, we could just delete the
modification entirely AFAICT.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-amlogic/attachments/20260501/a1ba7fc5/attachment.sig>


More information about the linux-amlogic mailing list