[PATCH v2 2/2] mtd: rawnand: arasan: drop manual GPIO CS release

zhaofeng2 at cmss.chinamobile.com zhaofeng2 at cmss.chinamobile.com
Tue Nov 17 18:12:47 PST 2026


From: Zhao Feng <zhaofeng2 at cmss.chinamobile.com>

With rawnand_dt_parse_gpio_cs() acquiring the CS GPIO descriptors
through devm_gpiod_get_index_optional(), the descriptors are owned and
released by the device-managed framework on probe failure and at
anfc_remove() time.  The manual gpiod_put() loop in anfc_remove() is
therefore redundant, and would double-release the descriptors once the
core helper is switched to devres.

Drop the manual loop.

v2: respun together with the core devres change (1/2).

Signed-off-by: Zhao Feng <zhaofeng2 at cmss.chinamobile.com>
---
Verified against current upstream master.  Not runtime-tested (no
Arasan hardware).

 drivers/mtd/nand/raw/arasan-nand-controller.c | 9 +------
 1 file changed, 2 deletions(-)

--- a/drivers/mtd/nand/raw/arasan-nand-controller.c
+++ b/drivers/mtd/nand/raw/arasan-nand-controller.c
@@ -1478,14 +1478,7 @@
 
 static void anfc_remove(struct platform_device *pdev)
 {
-	int i;
 	struct arasan_nfc *nfc = platform_get_drvdata(pdev);
-
-	for (i = 0; i < nfc->ncs; i++) {
-		if (nfc->cs_array[i]) {
-			gpiod_put(nfc->cs_array[i]);
-		}
-	}
 
 	anfc_chips_cleanup(nfc);
 }





More information about the linux-mtd mailing list