Add Waldemar's patches for Linux 3.2
[yaffs2.git] / yaffs_mtdif1_single.c
index 467a0319f74ff4d8fda305d159539e86d589ba14..a6907bff6056cb1404f9ef3cb99d288d89668126 100644 (file)
@@ -97,7 +97,7 @@ int nandmtd1_write_chunk_tags(struct yaffs_dev *dev,
         }
 
        memset(&ops, 0, sizeof(ops));
-       ops.mode = MTD_OOB_AUTO;
+       ops.mode = MTD_OPS_AUTO_OOB;
        ops.len = (data) ? chunk_bytes : 0;
        ops.ooblen = dev->param.tags_9bytes ? 9 : 8;
        ops.datbuf = (u8 *) data;
@@ -150,7 +150,7 @@ int nandmtd1_read_chunk_tags(struct yaffs_dev *dev,
        int deleted;
 
        memset(&ops, 0, sizeof(ops));
-       ops.mode = MTD_OOB_AUTO;
+       ops.mode = MTD_OPS_AUTO_OOB;
        ops.len = (data) ? chunk_bytes : 0;
        ops.ooblen =  dev->param.tags_9bytes ? 9 : 8;
        ops.datbuf = data;
@@ -259,7 +259,7 @@ int nandmtd1_mark_block_bad(struct yaffs_dev *dev, int block_no)
  *
  * Returns YAFFS_OK or YAFFS_FAIL.
  */
-static int nandmtd1_test_prerequists(struct mtd_info *mtd)
+static int nandmtd1_test_prerequists(struct yaffs_dev *dev, struct mtd_info *mtd)
 {
        /* 2.6.18 has mtd->ecclayout->oobavail */
        /* 2.6.21 has mtd->ecclayout->oobavail and mtd->oobavail */
@@ -268,7 +268,7 @@ static int nandmtd1_test_prerequists(struct mtd_info *mtd)
        if (oobavail < (dev->param.tags_9bytes ? 9 : 8)) {
                yaffs_trace(YAFFS_TRACE_ERROR,
                        "mtd device has only %d bytes for tags, need %d",
-                       oobavail, (dev->param.tags_9bytes ? 9 : 8);
+                       oobavail, (dev->param.tags_9bytes ? 9 : 8));
                return YAFFS_FAIL;
        }
        return YAFFS_OK;
@@ -297,7 +297,7 @@ int nandmtd1_query_block(struct yaffs_dev *dev, int block_no,
        /* We don't yet have a good place to test for MTD config prerequists.
         * Do it here as we are called during the initial scan.
         */
-       if (nandmtd1_test_prerequists(mtd) != YAFFS_OK)
+       if (nandmtd1_test_prerequists(dev, mtd) != YAFFS_OK)
                return YAFFS_FAIL;
 
        retval = nandmtd1_read_chunk_tags(dev, chunk_num, NULL, &etags);