]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/mtd/ubi/build.c
mtd,ubi,ubifs: sync with linux v3.15
[karo-tx-uboot.git] / drivers / mtd / ubi / build.c
index 7094b9c0e81bc1b2c6c2782233f8732a19726233..ff8bf0cedfcb6faed7591c7fca71abb48206be43 100644 (file)
@@ -1331,6 +1331,15 @@ int ubi_init(void)
                }
        }
 
+       err = ubiblock_init();
+       if (err) {
+               ubi_err("block: cannot initialize, error %d", err);
+
+               /* See comment above re-ubi_is_module(). */
+               if (ubi_is_module())
+                       goto out_detach;
+       }
+
        return 0;
 
 out_detach:
@@ -1363,6 +1372,8 @@ void ubi_exit(void)
 {
        int i;
 
+       ubiblock_exit();
+
        for (i = 0; i < UBI_MAX_DEVICES; i++)
                if (ubi_devices[i]) {
                        mutex_lock(&ubi_devices_mutex);