]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/ubi/build.c
ARM: OMAP4+: Change the PRCM structure prototype common for all Socs
[u-boot] / drivers / mtd / ubi / build.c
index 354e80b528effcdae04ee73fe9fbcff3ce6e4a5a..d144ac29bc5f21c1ac84c1932802f6579a796565 100644 (file)
@@ -476,21 +476,21 @@ static int attach_by_scanning(struct ubi_device *ubi)
        if (err)
                goto out_si;
 
-       err = ubi_wl_init_scan(ubi, si);
-       if (err)
-               goto out_vtbl;
-
        err = ubi_eba_init_scan(ubi, si);
        if (err)
                goto out_wl;
 
+       err = ubi_wl_init_scan(ubi, si);
+       if (err)
+               goto out_vtbl;
+
        ubi_scan_destroy_si(si);
        return 0;
 
-out_wl:
-       ubi_wl_close(ubi);
 out_vtbl:
        vfree(ubi->vtbl);
+out_wl:
+       ubi_wl_close(ubi);
 out_si:
        ubi_scan_destroy_si(si);
        return err;
@@ -1045,6 +1045,7 @@ out_version:
 out_class:
        class_destroy(ubi_class);
 out:
+       mtd_devs = 0;
        ubi_err("UBI error: cannot initialize UBI, error %d", err);
        return err;
 }