Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[firefly-linux-kernel-4.4.55.git] / drivers / mtd / mtdcore.c
index 41dc501cb49ae3f5f65a65dbb158353eb651a124..95c13b2ffa799e59f453e8a95813171cd56a13fc 100644 (file)
@@ -598,8 +598,10 @@ int mtd_device_parse_register(struct mtd_info *mtd, const char * const *types,
        }
        /* Didn't come up with either parsed OR fallback partitions */
        if (ret < 0) {
-               pr_info("mtd: failed to find partitions\n");
-               goto out;
+               pr_info("mtd: failed to find partitions; one or more parsers reports errors (%d)\n",
+                       ret);
+               /* Don't abort on errors; we can still use unpartitioned MTD */
+               ret = 0;
        }
 
        ret = mtd_add_device_partitions(mtd, real_parts, ret);
@@ -614,7 +616,8 @@ int mtd_device_parse_register(struct mtd_info *mtd, const char * const *types,
         * does cause problems with parse_mtd_partitions() above (e.g.,
         * cmdlineparts will register partitions more than once).
         */
-       WARN_ONCE(mtd->reboot_notifier.notifier_call, "MTD already registered\n");
+       WARN_ONCE(mtd->_reboot && mtd->reboot_notifier.notifier_call,
+                 "MTD already registered\n");
        if (mtd->_reboot && !mtd->reboot_notifier.notifier_call) {
                mtd->reboot_notifier.notifier_call = mtd_reboot_notifier;
                register_reboot_notifier(&mtd->reboot_notifier);
@@ -1213,8 +1216,7 @@ EXPORT_SYMBOL_GPL(mtd_writev);
  */
 void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size)
 {
-       gfp_t flags = __GFP_NOWARN | __GFP_WAIT |
-                      __GFP_NORETRY | __GFP_NO_KSWAPD;
+       gfp_t flags = __GFP_NOWARN | __GFP_DIRECT_RECLAIM | __GFP_NORETRY;
        size_t min_alloc = max_t(size_t, mtd->writesize, PAGE_SIZE);
        void *kbuf;