kernel: import pending patches adding support for NVMEM on UBI and MMC
[openwrt/staging/dangole.git] / target / linux / generic / pending-6.1 / 490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch
index 765eecd9d713fff92c87708420ea1a3a394609a9..2eccb9d3bbb513ec02d0b2f21f48995b09b71495 100644 (file)
@@ -8,10 +8,11 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 
 --- 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.
@@ -79,10 +80,10 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 +      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)
                }
        }
  
@@ -92,6 +93,6 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 +          !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: