From: Miquel Raynal <miquel.raynal@bootlin.com>
To: <linux-mtd@lists.infradead.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
Miquel Raynal <miquel.raynal@bootlin.com>
Subject: [PATCH v2 62/62] mtd: rawnand: Stop using nand_release()
Date: Tue, 19 May 2020 15:00:35 +0200 [thread overview]
Message-ID: <20200519130035.1883-63-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().
Now that all drivers have been converted to do not use nand_release()
anymore, let's remove this helper.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Jonathan Corbet <corbet@lwn.net>
---
Documentation/driver-api/mtdnand.rst | 6 ++++--
drivers/mtd/nand/raw/nand_base.c | 12 ------------
include/linux/mtd/bbm.h | 2 +-
include/linux/mtd/rawnand.h | 2 --
4 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/Documentation/driver-api/mtdnand.rst b/Documentation/driver-api/mtdnand.rst
index 55447659b81f..0bf8d6ec3f54 100644
--- a/Documentation/driver-api/mtdnand.rst
+++ b/Documentation/driver-api/mtdnand.rst
@@ -276,8 +276,10 @@ unregisters the partitions in the MTD layer.
#ifdef MODULE
static void __exit board_cleanup (void)
{
- /* Release resources, unregister device */
- nand_release (mtd_to_nand(board_mtd));
+ /* Unregister device */
+ WARN_ON(mtd_device_unregister(board_mtd));
+ /* Release resources */
+ nand_cleanup(mtd_to_nand(board_mtd));
/* unmap physical address */
iounmap(baseaddr);
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 14387b967e8b..5d8d7c145774 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -6169,18 +6169,6 @@ void nand_cleanup(struct nand_chip *chip)
EXPORT_SYMBOL_GPL(nand_cleanup);
-/**
- * nand_release - [NAND Interface] Unregister the MTD device and free resources
- * held by the NAND device
- * @chip: NAND chip object
- */
-void nand_release(struct nand_chip *chip)
-{
- mtd_device_unregister(nand_to_mtd(chip));
- nand_cleanup(chip);
-}
-EXPORT_SYMBOL_GPL(nand_release);
-
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Steven J. Hill <sjhill@realitydiluted.com>");
MODULE_AUTHOR("Thomas Gleixner <tglx@linutronix.de>");
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
index 886e30441c90..d890805f5494 100644
--- a/include/linux/mtd/bbm.h
+++ b/include/linux/mtd/bbm.h
@@ -98,7 +98,7 @@ struct nand_bbt_descr {
/*
* Flag set by nand_create_default_bbt_descr(), marking that the nand_bbt_descr
- * was allocated dynamicaly and must be freed in nand_release(). Has no meaning
+ * was allocated dynamicaly and must be freed in nand_cleanup(). Has no meaning
* in nand_chip.bbt_options.
*/
#define NAND_BBT_DYNAMICSTRUCT 0x80000000
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index 45dd57e2a223..12b1c8d0eea1 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -1396,8 +1396,6 @@ void nand_wait_ready(struct nand_chip *chip);
* sucessful nand_scan().
*/
void nand_cleanup(struct nand_chip *chip);
-/* Unregister the MTD device and calls nand_cleanup() */
-void nand_release(struct nand_chip *chip);
/*
* External helper for controller drivers that have to implement the WAITRDY
--
2.20.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2020-05-19 13:16 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 ` [PATCH v2 31/62] mtd: rawnand: ndfc: " Miquel Raynal
2020-05-24 19:06 ` 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 ` Miquel Raynal [this message]
2020-05-27 14:11 ` [PATCH v2 62/62] mtd: rawnand: " 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-63-miquel.raynal@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=corbet@lwn.net \
--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).