]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mtd: nand: distinguish between allocation failure and missing buffers with NAND_OWN_B...
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 22 Aug 2013 14:28:12 +0000 (16:28 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 22 Aug 2013 14:28:12 +0000 (16:28 +0200)
drivers/mtd/nand/nand_base.c

index 80613ab277c225d8e7bdfc8259fbec74b9a6412a..97de8cdd017ac30e481bcc118bad7f734c0e996e 100644 (file)
@@ -3112,7 +3112,7 @@ int nand_scan_tail(struct mtd_info *mtd)
                chip->buffers = memalign(ARCH_DMA_MINALIGN,
                                         sizeof(*chip->buffers));
        if (!chip->buffers)
-               return -ENOMEM;
+               return chip->options & NAND_OWN_BUFFERS ? -EINVAL : -ENOMEM;
 
        /* Set the internal oob buffer location, just after the page data */
        chip->oob_poi = chip->buffers->databuf + mtd->writesize;