Commit 6ac64a17 authored by Miquel Raynal's avatar Miquel Raynal

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: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Acked-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-11-miquel.raynal@bootlin.com
parent a9575c48
...@@ -1359,10 +1359,12 @@ EXPORT_SYMBOL(denali_init); ...@@ -1359,10 +1359,12 @@ EXPORT_SYMBOL(denali_init);
void denali_remove(struct denali_controller *denali) 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); nand_release(&dchip->chip);
list_del(&dchip->node);
}
denali_disable_irq(denali); denali_disable_irq(denali);
} }
......
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