projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c5be12e
)
mtd: rawnand: diskonchip: Stop using nand_release()
author
Miquel Raynal
<miquel.raynal@bootlin.com>
Tue, 19 May 2020 12:59:46 +0000
(14:59 +0200)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Sun, 31 May 2020 08:53:33 +0000
(10:53 +0200)
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>
Link:
https://lore.kernel.org/linux-mtd/20200519130035.1883-14-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/diskonchip.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/nand/raw/diskonchip.c
b/drivers/mtd/nand/raw/diskonchip.c
index f8ccee7976451f220d1fb30dca0932510af1e8b6..43721863a0d8ec1faa02090aa79a35b5977aed1d 100644
(file)
--- a/
drivers/mtd/nand/raw/diskonchip.c
+++ b/
drivers/mtd/nand/raw/diskonchip.c
@@
-1514,13
+1514,16
@@
static void release_nanddoc(void)
struct mtd_info *mtd, *nextmtd;
struct nand_chip *nand;
struct doc_priv *doc;
+ int ret;
for (mtd = doclist; mtd; mtd = nextmtd) {
nand = mtd_to_nand(mtd);
doc = nand_get_controller_data(nand);
nextmtd = doc->nextdoc;
- nand_release(nand);
+ ret = mtd_device_unregister(mtd);
+ WARN_ON(ret);
+ nand_cleanup(nand);
iounmap(doc->virtadr);
release_mem_region(doc->physadr, DOC_IOREMAP_LEN);
free_rs(doc->rs_decoder);