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@xxxxxxxxxxx> --- 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/