summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2020-05-25 10:58:40 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2020-05-31 10:53:37 +0200
commitcde495f83959119d0d2c78e74118a61301b8af32 (patch)
tree26d667fad4a4f594a21565bee3e02e37e32a9960 /drivers
parentmtd: rawnand: nandsim: Keep track of the created debugfs entries (diff)
downloadlinux-cde495f83959119d0d2c78e74118a61301b8af32.tar.xz
linux-cde495f83959119d0d2c78e74118a61301b8af32.zip
mtd: rawnand: nandsim: Remove debugfs entries at unload time
Create a ns_debugfs_remove() helper for that and call it in ns_cleanup_module(). Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-7-miquel.raynal@bootlin.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/raw/nandsim.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
index c8e9c70a6641..a439949945f7 100644
--- a/drivers/mtd/nand/raw/nandsim.c
+++ b/drivers/mtd/nand/raw/nandsim.c
@@ -520,6 +520,11 @@ static int ns_debugfs_create(struct nandsim *ns)
return 0;
}
+static void ns_debugfs_remove(struct nandsim *ns)
+{
+ debugfs_remove_recursive(ns->dent);
+}
+
/*
* Allocate array of page pointers, create slab allocation for an array
* and initialize the array by NULL pointers.
@@ -2398,6 +2403,7 @@ static void __exit ns_cleanup_module(void)
struct nandsim *ns = nand_get_controller_data(chip);
int i;
+ ns_debugfs_remove(ns);
ns_free(ns); /* Free nandsim private resources */
nand_release(chip); /* Unregister driver */
for (i = 0;i < ARRAY_SIZE(ns->partitions); ++i)