[PATCH v15 13/24] mtd: nand: raw: sunxi: Convert to common field_{get, prep}() helpers

Mikhail Kshevetskiy mikhail.kshevetskiy at iopsys.eu
Fri Jul 3 13:56:16 CEST 2026


Drop the driver-specific field_get() and field_prep() macros, in favor
of the globally available variants from <linux/bitfield.h>.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
---
 drivers/mtd/nand/raw/sunxi_nand.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/raw/sunxi_nand.h b/drivers/mtd/nand/raw/sunxi_nand.h
index b470e1d3368..1b2c514852d 100644
--- a/drivers/mtd/nand/raw/sunxi_nand.h
+++ b/drivers/mtd/nand/raw/sunxi_nand.h
@@ -24,12 +24,7 @@
 #define SUNXI_NAND_H
 
 #include <linux/bitops.h>
-
-/* non compile-time field get/prep */
-#undef field_get
-#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1))
-#undef field_prep
-#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask))
+#include <linux/bitfield.h>
 
 #define NFC_REG_CTL		0x0000
 #define NFC_REG_ST		0x0004
-- 
2.53.0



More information about the U-Boot mailing list