diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-05-19 15:00:27 +0200 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-05-31 10:53:36 +0200 |
commit | 068d86ecd9d980b10532d8b141badaf5d8d6b7dc (patch) | |
tree | 4248c5b581daa82534fdb4533a417bfd0f822e4e | |
parent | mtd: rawnand: sunxi: Fix the probe error path (diff) | |
download | linux-068d86ecd9d980b10532d8b141badaf5d8d6b7dc.tar.xz linux-068d86ecd9d980b10532d8b141badaf5d8d6b7dc.zip |
mtd: rawnand: sunxi: 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-55-miquel.raynal@bootlin.com
-rw-r--r-- | drivers/mtd/nand/raw/sunxi_nand.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c index 9f51fd20a52e..ffbc1651fadc 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -2039,13 +2039,18 @@ static int sunxi_nand_chips_init(struct device *dev, struct sunxi_nfc *nfc) static void sunxi_nand_chips_cleanup(struct sunxi_nfc *nfc) { struct sunxi_nand_chip *sunxi_nand; + struct nand_chip *chip; + int ret; while (!list_empty(&nfc->chips)) { sunxi_nand = list_first_entry(&nfc->chips, struct sunxi_nand_chip, node); - nand_release(&sunxi_nand->nand); - sunxi_nand_ecc_cleanup(&sunxi_nand->nand.ecc); + chip = &sunxi_nand->nand; + ret = mtd_device_unregister(nand_to_mtd(chip)); + WARN_ON(ret); + nand_cleanup(chip); + sunxi_nand_ecc_cleanup(&chip->ecc); list_del(&sunxi_nand->node); } } |