linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: <linux-mtd@lists.infradead.org>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Subject: [PATCH v2 31/62] mtd: rawnand: ndfc: Stop using nand_release()
Date: Tue, 19 May 2020 15:00:04 +0200	[thread overview]
Message-ID: <20200519130035.1883-32-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20200519130035.1883-1-miquel.raynal@bootlin.com>

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>
---
 drivers/mtd/nand/raw/ndfc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/ndfc.c b/drivers/mtd/nand/raw/ndfc.c
index d324396ab7ff..ed38338c1383 100644
--- a/drivers/mtd/nand/raw/ndfc.c
+++ b/drivers/mtd/nand/raw/ndfc.c
@@ -244,9 +244,13 @@ static int ndfc_probe(struct platform_device *ofdev)
 static int ndfc_remove(struct platform_device *ofdev)
 {
 	struct ndfc_controller *ndfc = dev_get_drvdata(&ofdev->dev);
-	struct mtd_info *mtd = nand_to_mtd(&ndfc->chip);
+	struct nand_chip *chip = &ndfc->chip;
+	struct mtd_info *mtd = nand_to_mtd(chip);
+	int ret;
 
-	nand_release(&ndfc->chip);
+	ret = mtd_device_unregister(mtd);
+	WARN_ON(ret);
+	nand_cleanup(chip);
 	kfree(mtd->name);
 
 	return 0;
-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  parent reply	other threads:[~2020-05-19 13:09 UTC|newest]

Thread overview: 136+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 01/62] mtd: rawnand: ams-delta: Stop using nand_release() Miquel Raynal
2020-05-24 19:09   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 02/62] mtd: rawnand: au1550nd: " Miquel Raynal
2020-05-24 19:09   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 03/62] mtd: rawnand: bcm47xx: " Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 04/62] mtd: rawnand: brcmnand: " Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 05/62] mtd: rawnand: cadence: " Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 06/62] mtd: rawnand: cafe: " Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 07/62] mtd: rawnand: cmx270: " Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 08/62] mtd: rawnand: cs553x: " Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 09/62] mtd: rawnand: davinci: " Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 10/62] mtd: rawnand: denali: Delete items from the list in the _remove() path Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 11/62] mtd: rawnand: denali: Stop using nand_release() Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 12/62] mtd: rawnand: diskonchip: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 13/62] mtd: rawnand: diskonchip: Stop using nand_release() Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 14/62] mtd: rawnand: fsl_elbc: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 15/62] mtd: rawnand: fsl_ifc: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 16/62] mtd: rawnand: fsl_upm: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 17/62] mtd: rawnand: fsmc: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 18/62] mtd: rawnand: gpio: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 19/62] mtd: rawnand: gpmi: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 20/62] mtd: rawnand: hisi504: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 21/62] mtd: rawnand: ingenic: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 22/62] mtd: rawnand: ingenic: Stop using nand_release() Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 23/62] mtd: rawnand: lpc32xx_mlc: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 24/62] mtd: rawnand: lpc32xx_slc: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 25/62] mtd: rawnand: marvell: " Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 26/62] mtd: rawnand: mpc5121: " Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 27/62] mtd: rawnand: mtk: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 28/62] mtd: rawnand: mtk: Stop using nand_release() Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 29/62] mtd: rawnand: mxc: " Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 30/62] mtd: rawnand: mxic: " Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` Miquel Raynal [this message]
2020-05-24 19:06   ` [PATCH v2 31/62] mtd: rawnand: ndfc: " Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 32/62] mtd: rawnand: omap2: " Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 33/62] mtd: rawnand: orion: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 34/62] mtd: rawnand: orion: Stop using nand_release() Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 35/62] mtd: rawnand: oxnas: Keep track of registered devices Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 36/62] mtd: rawnand: oxnas: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 37/62] mtd: rawnand: oxnas: Unregister all devices on error Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 38/62] mtd: rawnand: oxnas: Release all devices in the _remove() path Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 39/62] mtd: rawnand: oxnas: Stop using nand_release() Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 40/62] mtd: rawnand: pasemi: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 41/62] mtd: rawnand: pasemi: Stop using nand_release() Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 42/62] mtd: rawnand: plat_nand: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 43/62] mtd: rawnand: plat_nand: Stop using nand_release() Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 44/62] mtd: rawnand: qcom: " Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 45/62] mtd: rawnand: r852: " Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 46/62] mtd: rawnand: s3c2410: " Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 47/62] mtd: rawnand: sh_flctl: " Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 48/62] mtd: rawnand: sharpsl: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 49/62] mtd: rawnand: sharpsl: Stop using nand_release() Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 50/62] mtd: rawnand: socrates: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 51/62] mtd: rawnand: socrates: Stop using nand_release() Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 52/62] mtd: rawnand: stm32_fmc2: " Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 53/62] mtd: rawnand: sunxi: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 54/62] mtd: rawnand: sunxi: Stop using nand_release() Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 55/62] mtd: rawnand: tango: " Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 56/62] mtd: rawnand: tmio: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 57/62] mtd: rawnand: tmio: Stop using nand_release() Miquel Raynal
2020-05-24 19:03   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 58/62] mtd: rawnand: txx9ndfmc: " Miquel Raynal
2020-05-24 19:03   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 59/62] mtd: rawnand: vf610: " Miquel Raynal
2020-05-24 19:03   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 60/62] mtd: rawnand: xway: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:03   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 61/62] mtd: rawnand: xway: Stop using nand_release() Miquel Raynal
2020-05-24 19:03   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 62/62] mtd: rawnand: " Miquel Raynal
2020-05-27 14:11   ` Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200519130035.1883-32-miquel.raynal@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).