summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/raw/denali.c
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2020-05-19 14:59:44 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2020-05-31 10:53:33 +0200
commit009e2e1d831897794e6ff7ea4767af8a420360d3 (patch)
treed2e041fd1426f3b5d01ee3a7028ad795829588f7 /drivers/mtd/nand/raw/denali.c
parentmtd: rawnand: denali: Delete items from the list in the _remove() path (diff)
downloadlinux-009e2e1d831897794e6ff7ea4767af8a420360d3.tar.xz
linux-009e2e1d831897794e6ff7ea4767af8a420360d3.zip
mtd: rawnand: denali: Stop using nand_release()
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. 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-12-miquel.raynal@bootlin.com
Diffstat (limited to 'drivers/mtd/nand/raw/denali.c')
-rw-r--r--drivers/mtd/nand/raw/denali.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/denali.c b/drivers/mtd/nand/raw/denali.c
index 6ac125b9e927..4e6e1578aa2d 100644
--- a/drivers/mtd/nand/raw/denali.c
+++ b/drivers/mtd/nand/raw/denali.c
@@ -1360,9 +1360,14 @@ EXPORT_SYMBOL(denali_init);
void denali_remove(struct denali_controller *denali)
{
struct denali_chip *dchip, *tmp;
+ struct nand_chip *chip;
+ int ret;
list_for_each_entry_safe(dchip, tmp, &denali->chips, node) {
- nand_release(&dchip->chip);
+ chip = &dchip->chip;
+ ret = mtd_device_unregister(nand_to_mtd(chip));
+ WARN_ON(ret);
+ nand_cleanup(chip);
list_del(&dchip->node);
}