Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <miquel.raynal@bootlin.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-63-miquel.raynal@bootlin.com

+5 -17
+4 -2
Documentation/driver-api/mtdnand.rst
··· 276 276 #ifdef MODULE 277 277 static void __exit board_cleanup (void) 278 278 { 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)); 281 283 282 284 /* unmap physical address */ 283 285 iounmap(baseaddr);
-12
drivers/mtd/nand/raw/nand_base.c
··· 6178 6178 6179 6179 EXPORT_SYMBOL_GPL(nand_cleanup); 6180 6180 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 - 6193 6181 MODULE_LICENSE("GPL"); 6194 6182 MODULE_AUTHOR("Steven J. Hill <sjhill@realitydiluted.com>"); 6195 6183 MODULE_AUTHOR("Thomas Gleixner <tglx@linutronix.de>");
+1 -1
include/linux/mtd/bbm.h
··· 98 98 99 99 /* 100 100 * 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 102 102 * in nand_chip.bbt_options. 103 103 */ 104 104 #define NAND_BBT_DYNAMICSTRUCT 0x80000000
-2
include/linux/mtd/rawnand.h
··· 1398 1398 * sucessful nand_scan(). 1399 1399 */ 1400 1400 void nand_cleanup(struct nand_chip *chip); 1401 - /* Unregister the MTD device and calls nand_cleanup() */ 1402 - void nand_release(struct nand_chip *chip); 1403 1401 1404 1402 /* 1405 1403 * External helper for controller drivers that have to implement the WAITRDY