All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Tudor Ambarus <Tudor.Ambarus@microchip.com>,
	<linux-mtd@lists.infradead.org>
Cc: Boris Brezillon <boris.brezillon@collabora.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: [PATCH 08/62] mtd: rawnand: cs553x: Stop using nand_release()
Date: Sun, 10 May 2020 14:11:26 +0200	[thread overview]
Message-ID: <20200510121220.18042-9-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20200510121220.18042-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/cs553x_nand.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/cs553x_nand.c b/drivers/mtd/nand/raw/cs553x_nand.c
index e2322cee3229..98f13e4c634c 100644
--- a/drivers/mtd/nand/raw/cs553x_nand.c
+++ b/drivers/mtd/nand/raw/cs553x_nand.c
@@ -315,6 +315,7 @@ static void __exit cs553x_cleanup(void)
 		struct mtd_info *mtd = cs553x_mtd[i];
 		struct nand_chip *this;
 		void __iomem *mmio_base;
+		int ret;
 
 		if (!mtd)
 			continue;
@@ -323,8 +324,9 @@ static void __exit cs553x_cleanup(void)
 		mmio_base = this->legacy.IO_ADDR_R;
 
 		/* Release resources, unregister device */
-		nand_release(this);
-		kfree(mtd->name);
+		ret = mtd_device_unregister(mtd);
+		WARN_ON(ret);
+		nand_cleanup(this);
 		cs553x_mtd[i] = NULL;
 
 		/* unmap physical address */
-- 
2.20.1


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

  parent reply	other threads:[~2020-05-10 12:15 UTC|newest]

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

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=20200510121220.18042-9-miquel.raynal@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=boris.brezillon@collabora.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.