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

From: zhaofeng2

Date: Tue Nov 17 2026 - 21:13:15 EST


From: Zhao Feng <zhaofeng2@xxxxxxxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxxx>
---
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);
}