Commit 0a5f45e5 authored by Miquel Raynal's avatar Miquel Raynal

mtd: rawnand: oxnas: Release all devices in the _remove() path

oxnans_nand_remove() should release all MTD devices and clean all NAND
devices, not only the first one registered.

Fixes: 66859249 ("mtd: nand: Add OX820 NAND Support")
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-39-miquel.raynal@bootlin.com
parent b60391eb
...@@ -177,9 +177,13 @@ static int oxnas_nand_probe(struct platform_device *pdev) ...@@ -177,9 +177,13 @@ static int oxnas_nand_probe(struct platform_device *pdev)
static int oxnas_nand_remove(struct platform_device *pdev) static int oxnas_nand_remove(struct platform_device *pdev)
{ {
struct oxnas_nand_ctrl *oxnas = platform_get_drvdata(pdev); struct oxnas_nand_ctrl *oxnas = platform_get_drvdata(pdev);
struct nand_chip *chip;
int i;
if (oxnas->chips[0]) for (i = 0; i < oxnas->nchips; i++) {
nand_release(oxnas->chips[0]); chip = oxnas->chips[i];
nand_release(chip);
}
clk_disable_unprepare(oxnas->clk); clk_disable_unprepare(oxnas->clk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment