Add Waldemar's patches for Linux 3.2
[yaffs2.git] / yaffs_mtdif1_multi.c
index 3673891c3b4450f1f5dc5d9d37deafddcf579203..14d5c6f0d3579b5c6e82c12878253fe0b762da16 100644 (file)
 #include "linux/types.h"
 #include "linux/mtd/mtd.h"
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0))
+#define MTD_OPS_AUTO_OOB MTD_OOB_AUTO
+#endif
+
+
 /* Don't compile this module if we don't have MTD's mtd_oob_ops interface */
 #if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17))
 
@@ -124,7 +129,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;
@@ -177,7 +182,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;