[PATCH] mtd: rawnand: xway: depend on MTD_RAW_NAND=y
From: Pengpeng Hou
Date: Thu Dec 03 2026 - 20:59:34 EST
The XWAY NAND controller uses built-in platform registration and calls
the raw NAND core. A boolean controller selected under a modular raw
NAND core cannot provide a working built-in driver.
Require MTD_RAW_NAND=y for MTD_NAND_XWAY rather than relying on how the
top-level MTD directory happens to be entered.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: 73529c872a18 ("mtd: nand: xway: disable module support")
Signed-off-by: Pengpeng Hou <hppiscas@xxxxxxx>
---
The original patch was prepared with Gemini. Codex assisted with this
review and revision (Assisted-by: gpt 5).
Starting from the MIPS XWAY defconfig with MTD=y, Kconfig previously
accepted the driver with MTD_RAW_NAND=m. After the change the driver was
disabled with a modular raw NAND core (also with MTD=m) and remained
selectable with both cores built in. This was a Kconfig test using the
kernel dummy cross tools; no target binary was built.
drivers/mtd/nand/raw/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
index 1f4053e531fd88e2c25df663e82b122e0dc09bab..64ebd3b7a7134efe3c06c3c1c5f170cc495c070c 100644
--- a/drivers/mtd/nand/raw/Kconfig
+++ b/drivers/mtd/nand/raw/Kconfig
@@ -285,7 +285,7 @@ config MTD_NAND_FSMC
config MTD_NAND_XWAY
bool "Lantiq XWAY NAND controller"
- depends on LANTIQ && SOC_TYPE_XWAY
+ depends on LANTIQ && SOC_TYPE_XWAY && MTD_RAW_NAND=y
help
Enables support for NAND Flash chips on Lantiq XWAY SoCs. NAND is attached
to the External Bus Unit (EBU).
base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106