Remove the support for the old MTD.
[yaffs2.git] / yaffs_mtdif.c
index eeb0d8aff6c382d5ed3447b9b63db76655c12be7..4c87542e71b5e525cd12dbd569b59e23fc85de0a 100644 (file)
  *
  */
 
-const char *yaffs_mtdif_c_version = "$Id: yaffs_mtdif.c,v 1.5 2005-07-31 06:47:12 marty Exp $";
+const char *yaffs_mtdif_c_version = "$Id: yaffs_mtdif.c,v 1.7 2005-08-01 20:52:35 luc Exp $";
  
 #include "yportenv.h"
 
-#ifdef CONFIG_YAFFS_MTD_ENABLED
+#ifdef CONFIG_YAFFS_YAFFS1
 
 #include "yaffs_mtdif.h"
 
 #include "linux/mtd/mtd.h"
 #include "linux/types.h"
 #include "linux/time.h"
-
-#ifndef        CONFIG_YAFFS_USE_OLD_MTD
 #include "linux/mtd/nand.h"
-#endif
 
 static struct nand_oobinfo yaffs_oobinfo = {
        .useecc = 1,
@@ -49,7 +46,6 @@ int nandmtd_WriteChunkToNAND(yaffs_Device *dev,int chunkInNAND,const __u8 *data,
        
        __u8 *spareAsBytes = (__u8 *)spare;
 
-#ifndef        CONFIG_YAFFS_USE_OLD_MTD
        if(data && spare)
        {
                if(dev->useNANDECC)
@@ -59,14 +55,11 @@ int nandmtd_WriteChunkToNAND(yaffs_Device *dev,int chunkInNAND,const __u8 *data,
        }
        else
        {
-#endif
        if(data)
                retval = mtd->write(mtd,addr,dev->nBytesPerChunk,&dummy,data);
        if(spare)
                retval = mtd->write_oob(mtd,addr,YAFFS_BYTES_PER_SPARE,&dummy,spareAsBytes);
-#ifndef        CONFIG_YAFFS_USE_OLD_MTD
        }
-#endif
 
     if (retval == 0)
        return YAFFS_OK;
@@ -84,7 +77,6 @@ int nandmtd_ReadChunkFromNAND(yaffs_Device *dev,int chunkInNAND, __u8 *data, yaf
        
        __u8 *spareAsBytes = (__u8 *)spare;
        
-#ifndef        CONFIG_YAFFS_USE_OLD_MTD
        if(data && spare)
        {
                if(dev->useNANDECC)
@@ -99,14 +91,11 @@ int nandmtd_ReadChunkFromNAND(yaffs_Device *dev,int chunkInNAND, __u8 *data, yaf
        }
        else
        {
-#endif
        if(data)
                retval = mtd->read(mtd,addr,dev->nBytesPerChunk,&dummy,data);
        if(spare)
                retval = mtd->read_oob(mtd,addr,YAFFS_BYTES_PER_SPARE,&dummy,spareAsBytes);
-#ifndef        CONFIG_YAFFS_USE_OLD_MTD
        }
-#endif
 
     if (retval == 0)
        return YAFFS_OK;
@@ -159,5 +148,5 @@ int nandmtd_InitialiseNAND(yaffs_Device *dev)
        return YAFFS_OK;
 }
 
-#endif // CONFIG_YAFFS_MTD_ENABLED
+#endif // CONFIG_YAFFS_YAFFS1