diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-05-19 15:00:32 +0200 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-05-31 10:53:36 +0200 |
commit | d9f2a1af817d5c9ee5a6adf70c5a217a583d3af0 (patch) | |
tree | a1c8197677c7887a2e85e9d4a8c566e21d99d0c6 | |
parent | f6fc75978d882e9c8970f11082f9be7e5ba95e45 (diff) | |
download | linux-d9f2a1af817d5c9ee5a6adf70c5a217a583d3af0.tar.bz2 |
mtd: rawnand: vf610: 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>
Cc: Stefan Agner <stefan@agner.ch>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-60-miquel.raynal@bootlin.com
-rw-r--r-- | drivers/mtd/nand/raw/vf610_nfc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c index bd9e16de78a2..7248c5901183 100644 --- a/drivers/mtd/nand/raw/vf610_nfc.c +++ b/drivers/mtd/nand/raw/vf610_nfc.c @@ -917,8 +917,12 @@ err_disable_clk: static int vf610_nfc_remove(struct platform_device *pdev) { struct vf610_nfc *nfc = platform_get_drvdata(pdev); + struct nand_chip *chip = &nfc->chip; + int ret; - nand_release(&nfc->chip); + ret = mtd_device_unregister(nand_to_mtd(chip)); + WARN_ON(ret); + nand_cleanup(chip); clk_disable_unprepare(nfc->clk); return 0; } |