summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2020-05-19 14:59:43 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2020-05-31 10:53:33 +0200
commit6ac64a17554ff98b5419af29ed139860a910ad0b (patch)
treec8fbcdb01f00468469369edb66988ecad057dd9b /drivers
parenta9575c48e52042ccc06105e6b7fe4a26f49f0a67 (diff)
mtd: rawnand: denali: Delete items from the list in the _remove() path
Denali driver keeps track of devices with a list. Delete items of this list as long as they are not in use anymore. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com> Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-11-miquel.raynal@bootlin.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/raw/denali.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/nand/raw/denali.c b/drivers/mtd/nand/raw/denali.c
index 7a76b761dd0b..6ac125b9e927 100644
--- a/drivers/mtd/nand/raw/denali.c
+++ b/drivers/mtd/nand/raw/denali.c
@@ -1359,10 +1359,12 @@ EXPORT_SYMBOL(denali_init);
void denali_remove(struct denali_controller *denali)
{
- struct denali_chip *dchip;
+ struct denali_chip *dchip, *tmp;
- list_for_each_entry(dchip, &denali->chips, node)
+ list_for_each_entry_safe(dchip, tmp, &denali->chips, node) {
nand_release(&dchip->chip);
+ list_del(&dchip->node);
+ }
denali_disable_irq(denali);
}