Skip to content
Snippets Groups Projects
Commit 40da2a2a authored by Heiko Schocher's avatar Heiko Schocher
Browse files

ubi: reset mtd_devs when ubi part fail


if "ubi part" fails, reset also mtd_devs to 0, as
further "ubi part" would use wrong mtd_devs.

Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
parent ab92da9f
No related branches found
No related tags found
No related merge requests found
......@@ -1358,6 +1358,10 @@ out_version:
out_class:
class_destroy(ubi_class);
out:
#ifdef __UBOOT__
/* Reset any globals that the driver depends on being zeroed */
mtd_devs = 0;
#endif
ubi_err("cannot initialize UBI, error %d", err);
return err;
}
......@@ -1384,6 +1388,10 @@ void ubi_exit(void)
misc_deregister(&ubi_ctrl_cdev);
class_remove_file(ubi_class, &ubi_version);
class_destroy(ubi_class);
#ifdef __UBOOT__
/* Reset any globals that the driver depends on being zeroed */
mtd_devs = 0;
#endif
}
module_exit(ubi_exit);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment