--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
-@@ -1212,6 +1212,73 @@ static struct mtd_info * __init open_mtd
- return mtd;
- }
+@@ -1263,6 +1263,74 @@ static struct mtd_notifier ubi_mtd_notif
+ .remove = ubi_notify_remove,
+ };
++
+/*
+ * This function tries attaching mtd partitions named either "ubi" or "data"
+ * during boot.
+ put_mtd_device(mtd);
+}
+
- static int __init ubi_init(void)
+ static int __init ubi_init_attach(void)
{
int err, i, k;
-@@ -1296,6 +1363,12 @@ static int __init ubi_init(void)
+@@ -1313,6 +1381,12 @@ static int __init ubi_init_attach(void)
}
}
+ !ubi_is_module() && !mtd_devs)
+ ubi_auto_attach();
+
- err = ubiblock_init();
- if (err) {
- pr_err("UBI error: block: cannot initialize, error %d\n", err);
+ return 0;
+
+ out_detach: