Skip to content

Commit d6e4fd5

Browse files
committed
mtd: rawnand: nandsim: Stop using nand_release()
nand_release() basically calls mtd_device_unregister() and nand_cleanup(). Both helpers should be called after MTD device registration and NAND scan, respectively. Drop nand_release() and use the two helpers directly so that they fit the error path and the labels there. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 72e840a commit d6e4fd5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/mtd/nand/raw/nandsim.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,13 +2400,15 @@ static int __init ns_init_module(void)
24002400

24012401
ret = ns_debugfs_create(ns);
24022402
if (ret)
2403-
goto err_exit;
2403+
goto unregister_mtd;
24042404

24052405
return 0;
24062406

2407+
unregister_mtd:
2408+
WARN_ON(mtd_device_unregister(nsmtd));
24072409
err_exit:
24082410
ns_free(ns);
2409-
nand_release(chip);
2411+
nand_cleanup(chip);
24102412
error:
24112413
kfree(ns);
24122414
ns_free_lists();

0 commit comments

Comments
 (0)