mtd: nand: remove unused NAND_OWN_BUFFERS flag
[linux-2.6-block.git] / drivers / mtd / nand / nand_base.c
index 215c52a3b9ad72121d079974d99a75166b33806a..b63cc95e917966d6a64d2757982720e5db96436f 100644 (file)
@@ -5319,35 +5319,30 @@ int nand_scan_tail(struct mtd_info *mtd)
                return -EINVAL;
        }
 
-       if (!(chip->options & NAND_OWN_BUFFERS)) {
-               nbuf = kzalloc(sizeof(*nbuf), GFP_KERNEL);
-               if (!nbuf)
-                       return -ENOMEM;
-
-               nbuf->ecccalc = kmalloc(mtd->oobsize, GFP_KERNEL);
-               if (!nbuf->ecccalc) {
-                       ret = -ENOMEM;
-                       goto err_free_nbuf;
-               }
+       nbuf = kzalloc(sizeof(*nbuf), GFP_KERNEL);
+       if (!nbuf)
+               return -ENOMEM;
 
-               nbuf->ecccode = kmalloc(mtd->oobsize, GFP_KERNEL);
-               if (!nbuf->ecccode) {
-                       ret = -ENOMEM;
-                       goto err_free_nbuf;
-               }
+       nbuf->ecccalc = kmalloc(mtd->oobsize, GFP_KERNEL);
+       if (!nbuf->ecccalc) {
+               ret = -ENOMEM;
+               goto err_free_nbuf;
+       }
 
-               nbuf->databuf = kmalloc(mtd->writesize + mtd->oobsize,
-                                       GFP_KERNEL);
-               if (!nbuf->databuf) {
-                       ret = -ENOMEM;
-                       goto err_free_nbuf;
-               }
+       nbuf->ecccode = kmalloc(mtd->oobsize, GFP_KERNEL);
+       if (!nbuf->ecccode) {
+               ret = -ENOMEM;
+               goto err_free_nbuf;
+       }
 
-               chip->buffers = nbuf;
-       } else if (!chip->buffers) {
-               return -ENOMEM;
+       nbuf->databuf = kmalloc(mtd->writesize + mtd->oobsize, GFP_KERNEL);
+       if (!nbuf->databuf) {
+               ret = -ENOMEM;
+               goto err_free_nbuf;
        }
 
+       chip->buffers = nbuf;
+
        /*
         * FIXME: some NAND manufacturer drivers expect the first die to be
         * selected when manufacturer->init() is called. They should be fixed
@@ -5701,7 +5696,7 @@ void nand_cleanup(struct nand_chip *chip)
 
        /* Free bad block table memory */
        kfree(chip->bbt);
-       if (!(chip->options & NAND_OWN_BUFFERS) && chip->buffers) {
+       if (chip->buffers) {
                kfree(chip->buffers->databuf);
                kfree(chip->buffers->ecccode);
                kfree(chip->buffers->ecccalc);