summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/raw/fsmc_nand.c
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2020-05-19 14:59:50 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2020-05-31 10:53:34 +0200
commit9cc02f4c0a87a9eba17e5c2cbbda375c9a4a2b06 (patch)
tree447076bf9f5a2897d3b7151854a7e46c6f038ec9 /drivers/mtd/nand/raw/fsmc_nand.c
parentf6c4e661491ab3de80b4568e2bcdbf52fcbbaf33 (diff)
downloadlinux-9cc02f4c0a87a9eba17e5c2cbbda375c9a4a2b06.tar.bz2
mtd: rawnand: fsmc: 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-18-miquel.raynal@bootlin.com
Diffstat (limited to 'drivers/mtd/nand/raw/fsmc_nand.c')
-rw-r--r--drivers/mtd/nand/raw/fsmc_nand.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c
index 2a9222e99bcc..3909752b14c5 100644
--- a/drivers/mtd/nand/raw/fsmc_nand.c
+++ b/drivers/mtd/nand/raw/fsmc_nand.c
@@ -1136,7 +1136,12 @@ static int fsmc_nand_remove(struct platform_device *pdev)
struct fsmc_nand_data *host = platform_get_drvdata(pdev);
if (host) {
- nand_release(&host->nand);
+ struct nand_chip *chip = &host->nand;
+ int ret;
+
+ ret = mtd_device_unregister(nand_to_mtd(chip));
+ WARN_ON(ret);
+ nand_cleanup(chip);
fsmc_nand_disable(host);
if (host->mode == USE_DMA_ACCESS) {