Commit 11e6831f authored by Maciej Andrzejewski's avatar Maciej Andrzejewski Committed by Miquel Raynal
Browse files

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: 197b88fe ("mtd: rawnand: arasan: Add new Arasan NAND controller")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMaciej Andrzejewski ICEYE <maciej.andrzejewski@m-works.net>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent b086a46d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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);
}