projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b60391e
)
mtd: rawnand: oxnas: Release all devices in the _remove() path
author
Miquel Raynal
<miquel.raynal@bootlin.com>
Tue, 19 May 2020 13:00:11 +0000
(15:00 +0200)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Sun, 31 May 2020 08:53:35 +0000
(10:53 +0200)
oxnans_nand_remove() should release all MTD devices and clean all NAND
devices, not only the first one registered.
Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link:
https://lore.kernel.org/linux-mtd/20200519130035.1883-39-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/oxnas_nand.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/nand/raw/oxnas_nand.c
b/drivers/mtd/nand/raw/oxnas_nand.c
index 25862d62f9948705f16cd4111bf73fdb321b0ed1..23c222b6c40e46860c915b435cf89c920620643e 100644
(file)
--- a/
drivers/mtd/nand/raw/oxnas_nand.c
+++ b/
drivers/mtd/nand/raw/oxnas_nand.c
@@
-177,9
+177,13
@@
err_clk_unprepare:
static int oxnas_nand_remove(struct platform_device *pdev)
{
struct oxnas_nand_ctrl *oxnas = platform_get_drvdata(pdev);
+ struct nand_chip *chip;
+ int i;
- if (oxnas->chips[0])
- nand_release(oxnas->chips[0]);
+ for (i = 0; i < oxnas->nchips; i++) {
+ chip = oxnas->chips[i];
+ nand_release(chip);
+ }
clk_disable_unprepare(oxnas->clk);