Skip to content

Commit 9630a05

Browse files
committed
mtd: rawnand: Stop using nand_release()
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 <[email protected]> Cc: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 5724fa7 commit 9630a05

File tree

4 files changed

+5
-17
lines changed

4 files changed

+5
-17
lines changed

Documentation/driver-api/mtdnand.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,10 @@ unregisters the partitions in the MTD layer.
276276
#ifdef MODULE
277277
static void __exit board_cleanup (void)
278278
{
279-
/* Release resources, unregister device */
280-
nand_release (mtd_to_nand(board_mtd));
279+
/* Unregister device */
280+
WARN_ON(mtd_device_unregister(board_mtd));
281+
/* Release resources */
282+
nand_cleanup(mtd_to_nand(board_mtd));
281283

282284
/* unmap physical address */
283285
iounmap(baseaddr);

drivers/mtd/nand/raw/nand_base.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6178,18 +6178,6 @@ void nand_cleanup(struct nand_chip *chip)
61786178

61796179
EXPORT_SYMBOL_GPL(nand_cleanup);
61806180

6181-
/**
6182-
* nand_release - [NAND Interface] Unregister the MTD device and free resources
6183-
* held by the NAND device
6184-
* @chip: NAND chip object
6185-
*/
6186-
void nand_release(struct nand_chip *chip)
6187-
{
6188-
mtd_device_unregister(nand_to_mtd(chip));
6189-
nand_cleanup(chip);
6190-
}
6191-
EXPORT_SYMBOL_GPL(nand_release);
6192-
61936181
MODULE_LICENSE("GPL");
61946182
MODULE_AUTHOR("Steven J. Hill <[email protected]>");
61956183
MODULE_AUTHOR("Thomas Gleixner <[email protected]>");

include/linux/mtd/bbm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ struct nand_bbt_descr {
9898

9999
/*
100100
* Flag set by nand_create_default_bbt_descr(), marking that the nand_bbt_descr
101-
* was allocated dynamicaly and must be freed in nand_release(). Has no meaning
101+
* was allocated dynamicaly and must be freed in nand_cleanup(). Has no meaning
102102
* in nand_chip.bbt_options.
103103
*/
104104
#define NAND_BBT_DYNAMICSTRUCT 0x80000000

include/linux/mtd/rawnand.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,8 +1398,6 @@ void nand_wait_ready(struct nand_chip *chip);
13981398
* sucessful nand_scan().
13991399
*/
14001400
void nand_cleanup(struct nand_chip *chip);
1401-
/* Unregister the MTD device and calls nand_cleanup() */
1402-
void nand_release(struct nand_chip *chip);
14031401

14041402
/*
14051403
* External helper for controller drivers that have to implement the WAITRDY

0 commit comments

Comments
 (0)