[Yaffs] [PATCH YAFFS2 5/8] remove-old-mtd-support

Startseite
Anhänge:
Nachricht
+ (text/plain)
+ 5-remove-old-mtd-support.diff (text/plain)
Nachricht löschen
Nachricht beantworten
Autor: Luc Van Oostenryck
Datum:  
To: yaffs
Betreff: [Yaffs] [PATCH YAFFS2 5/8] remove-old-mtd-support
Remove the support for the old MTD.




-- Luc Van Oostenryck
diff --git a/fs/yaffs2/yaffs_fs.c b/fs/yaffs2/yaffs_fs.c
--- a/fs/yaffs2/yaffs_fs.c
+++ b/fs/yaffs2/yaffs_fs.c
@@ -1384,10 +1384,8 @@ static struct super_block *yaffs_interna
                !mtd->block_markbad ||
                !mtd->read  ||
                !mtd->write ||
-#ifndef CONFIG_YAFFS_USE_OLD_MTD
                !mtd->write_ecc ||
                !mtd->read_ecc ||
-#endif
                !mtd->read_oob ||
                !mtd->write_oob )
             {
@@ -1407,10 +1405,8 @@ static struct super_block *yaffs_interna
             if(!mtd->erase ||
                !mtd->read  ||
                !mtd->write ||
-#ifndef CONFIG_YAFFS_USE_OLD_MTD
                !mtd->write_ecc ||
                !mtd->read_ecc ||
-#endif
                !mtd->read_oob ||
                !mtd->write_oob )
             {
diff --git a/fs/yaffs2/yaffs_mtdif.c b/fs/yaffs2/yaffs_mtdif.c
--- a/fs/yaffs2/yaffs_mtdif.c
+++ b/fs/yaffs2/yaffs_mtdif.c
@@ -24,10 +24,7 @@ const char *yaffs_mtdif_c_version = "$Id
 #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_Devic

    
     __u8 *spareAsBytes = (__u8 *)spare;


-#ifndef    CONFIG_YAFFS_USE_OLD_MTD
     if(data && spare)
     {
         if(dev->useNANDECC)
@@ -59,14 +55,11 @@ int nandmtd_WriteChunkToNAND(yaffs_Devic
     }
     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_Devi

    
     __u8 *spareAsBytes = (__u8 *)spare;

    
-#ifndef    CONFIG_YAFFS_USE_OLD_MTD
     if(data && spare)
     {
         if(dev->useNANDECC)
@@ -99,14 +91,11 @@ int nandmtd_ReadChunkFromNAND(yaffs_Devi
     }
     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;
diff --git a/fs/yaffs2/yaffs_mtdif2.c b/fs/yaffs2/yaffs_mtdif2.c
--- a/fs/yaffs2/yaffs_mtdif2.c
+++ b/fs/yaffs2/yaffs_mtdif2.c
@@ -50,7 +50,6 @@ int nandmtd2_WriteChunkWithTagsToNAND(ya
         yaffs_PackTags2(&pt,tags);
     }


-#ifndef    CONFIG_YAFFS_USE_OLD_MTD
     if(data && tags)
     {
         if(dev->useNANDECC)
@@ -60,15 +59,12 @@ int nandmtd2_WriteChunkWithTagsToNAND(ya
     }
     else
     {
-#endif
     if(data)
         retval = mtd->write(mtd,addr,dev->nBytesPerChunk,&dummy,data);
     if(tags)
         retval = mtd->write_oob(mtd,addr,mtd->oobsize,&dummy,(__u8 *)&pt);

        
-#ifndef    CONFIG_YAFFS_USE_OLD_MTD
     }
-#endif


     if (retval == 0)
         return YAFFS_OK;
@@ -89,7 +85,6 @@ int nandmtd2_ReadChunkWithTagsFromNAND(y


     T(YAFFS_TRACE_MTD,(TSTR("nandmtd2_ReadChunkWithTagsToNAND chunk %d data %p tags %p" TENDSTR),chunkInNAND,data,tags));    


-#ifndef    CONFIG_YAFFS_USE_OLD_MTD
     if(data && tags)
     {
         if(dev->useNANDECC)
@@ -103,14 +98,11 @@ int nandmtd2_ReadChunkWithTagsFromNAND(y
     }
     else
     {
-#endif
     if(data)
         retval = mtd->read(mtd,addr,dev->nBytesPerChunk,&dummy,data);
     if(tags)
         retval = mtd->read_oob(mtd,addr,mtd->oobsize,&dummy,dev->spareBuffer);
-#ifndef    CONFIG_YAFFS_USE_OLD_MTD
     }
-#endif


     memcpy(&pt,dev->spareBuffer,sizeof(pt));