]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
spi: meson-spicc: Use FIELD_MODIFY()
authorHans Zhang <18255117159@163.com>
Thu, 30 Apr 2026 15:54:50 +0000 (23:54 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 11 May 2026 12:05:07 +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>
Link: https://patch.msgid.link/20260430155456.36998-5-18255117159@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-meson-spicc.c

index b80f9f457b6674048954f089d101d489a6714413..682dda1144121984f83e6640df9c7fe49e3fdb27 100644 (file)
@@ -539,9 +539,8 @@ static void meson_spicc_setup_xfer(struct meson_spicc_device *spicc,
        conf = conf_orig = readl_relaxed(spicc->base + SPICC_CONREG);
 
        /* Setup word width */
-       conf &= ~SPICC_BITLENGTH_MASK;
-       conf |= FIELD_PREP(SPICC_BITLENGTH_MASK,
-                          (spicc->bytes_per_word << 3) - 1);
+       FIELD_MODIFY(SPICC_BITLENGTH_MASK, &conf,
+                    (spicc->bytes_per_word << 3) - 1);
 
        /* Ignore if unchanged */
        if (conf != conf_orig)