summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2015-01-20 09:05:23 +0100
committerHeiko Schocher <hs@denx.de>2015-01-28 07:41:18 +0100
commit40da2a2a08f12015d06d78a334e4d977963fee34 (patch)
treeabfbceaac1153b543241fec15a9e4ac3dd02b7d4 /drivers/mtd
parentab92da9f47d51d363c7de42e2a7bd807e2c1bd54 (diff)
downloadu-boot-imx-40da2a2a08f12015d06d78a334e4d977963fee34.zip
u-boot-imx-40da2a2a08f12015d06d78a334e4d977963fee34.tar.gz
u-boot-imx-40da2a2a08f12015d06d78a334e4d977963fee34.tar.bz2
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: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/build.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 584cf5f..290d524 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -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);