diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-05-19 14:59:55 +0200 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-05-31 10:53:34 +0200 |
commit | 28dcc4e8a8318beb77a7b42bccb9ed57707c546d (patch) | |
tree | b07664cc8e13604a5cdaaf2ee6381ffb73e5eac8 /drivers | |
parent | de17cade0e034e9b721a6db9b488014effac1e5a (diff) | |
download | linux-28dcc4e8a8318beb77a7b42bccb9ed57707c546d.tar.bz2 |
mtd: rawnand: ingenic: 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: Paul Cercueil <paul@crapouillou.net>
Cc: Harvey Hunt <harveyhuntnexus@gmail.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-23-miquel.raynal@bootlin.com
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c b/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c index 3bfb6fa8bad9..2af1b54d5d9d 100644 --- a/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c +++ b/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c @@ -387,13 +387,18 @@ static int ingenic_nand_init_chip(struct platform_device *pdev, static void ingenic_nand_cleanup_chips(struct ingenic_nfc *nfc) { - struct ingenic_nand *chip; + struct ingenic_nand *ingenic_chip; + struct nand_chip *chip; + int ret; while (!list_empty(&nfc->chips)) { - chip = list_first_entry(&nfc->chips, - struct ingenic_nand, chip_list); - nand_release(&chip->chip); - list_del(&chip->chip_list); + ingenic_chip = list_first_entry(&nfc->chips, + struct ingenic_nand, chip_list); + chip = &ingenic_chip->chip; + ret = mtd_device_unregister(nand_to_mtd(chip)); + WARN_ON(ret); + nand_cleanup(chip); + list_del(&ingenic_chip->chip_list); } } |