diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-05-19 15:59:42 +0300 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-05-31 11:53:33 +0300 |
commit | a9575c48e52042ccc06105e6b7fe4a26f49f0a67 (patch) | |
tree | 6698941f9dde31b0b91e33f77b832d81fd6fd704 /drivers/mtd/nand/raw/davinci_nand.c | |
parent | 970024f031aec4c761fde80572b8186c591af59c (diff) | |
download | linux-a9575c48e52042ccc06105e6b7fe4a26f49f0a67.tar.xz |
mtd: rawnand: davinci: 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>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-10-miquel.raynal@bootlin.com
Diffstat (limited to 'drivers/mtd/nand/raw/davinci_nand.c')
-rw-r--r-- | drivers/mtd/nand/raw/davinci_nand.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/davinci_nand.c b/drivers/mtd/nand/raw/davinci_nand.c index d8aa61a6928a..52b87304954b 100644 --- a/drivers/mtd/nand/raw/davinci_nand.c +++ b/drivers/mtd/nand/raw/davinci_nand.c @@ -823,13 +823,17 @@ err_cleanup_nand: static int nand_davinci_remove(struct platform_device *pdev) { struct davinci_nand_info *info = platform_get_drvdata(pdev); + struct nand_chip *chip = &info->chip; + int ret; spin_lock_irq(&davinci_nand_lock); if (info->chip.ecc.mode == NAND_ECC_HW_SYNDROME) ecc4_busy = false; spin_unlock_irq(&davinci_nand_lock); - nand_release(&info->chip); + ret = mtd_device_unregister(nand_to_mtd(chip)); + WARN_ON(ret); + nand_cleanup(chip); return 0; } |