diff options
author | 2024-12-02 19:58:36 +0100 | |
---|---|---|
committer | 2024-12-05 11:13:52 +0100 | |
commit | 11e6831fd81468cf48155b9b3c11295c391da723 (patch) | |
tree | 377de9e51de75270d120f36fb3c7f18d6a89ad57 | |
parent | mtd: rawnand: arasan: Fix double assertion of chip-select (diff) | |
download | wireguard-linux-11e6831fd81468cf48155b9b3c11295c391da723.tar.xz wireguard-linux-11e6831fd81468cf48155b9b3c11295c391da723.zip |
mtd: rawnand: arasan: Fix missing de-registration of NAND
The NAND chip-selects are registered for the Arasan driver during
initialization but are not de-registered when the driver is unloaded. As a
result, if the driver is loaded again, the chip-selects remain registered
and busy, making them unavailable for use.
Fixes: 197b88fecc50 ("mtd: rawnand: arasan: Add new Arasan NAND controller")
Cc: stable@vger.kernel.org
Signed-off-by: Maciej Andrzejewski ICEYE <maciej.andrzejewski@m-works.net>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
-rw-r--r-- | drivers/mtd/nand/raw/arasan-nand-controller.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mtd/nand/raw/arasan-nand-controller.c b/drivers/mtd/nand/raw/arasan-nand-controller.c index 26b506107a1a..865754737f5f 100644 --- a/drivers/mtd/nand/raw/arasan-nand-controller.c +++ b/drivers/mtd/nand/raw/arasan-nand-controller.c @@ -1478,8 +1478,15 @@ static int anfc_probe(struct platform_device *pdev) 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); } |