Skip to content

Commit 11e6831

Browse files
mandrzejewski-iceyemiquelraynal
authored andcommitted
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: 197b88f ("mtd: rawnand: arasan: Add new Arasan NAND controller") Cc: [email protected] Signed-off-by: Maciej Andrzejewski ICEYE <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent b086a46 commit 11e6831

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/mtd/nand/raw/arasan-nand-controller.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,8 +1478,15 @@ static int anfc_probe(struct platform_device *pdev)
14781478

14791479
static void anfc_remove(struct platform_device *pdev)
14801480
{
1481+
int i;
14811482
struct arasan_nfc *nfc = platform_get_drvdata(pdev);
14821483

1484+
for (i = 0; i < nfc->ncs; i++) {
1485+
if (nfc->cs_array[i]) {
1486+
gpiod_put(nfc->cs_array[i]);
1487+
}
1488+
}
1489+
14831490
anfc_chips_cleanup(nfc);
14841491
}
14851492

0 commit comments

Comments
 (0)