yaffs Restructuring timothy_tests folder.
[yaffs2.git] / yaffs_mtdif.c
index 4fc765ce38a467550487a998b432582a0388a80c..b2d4318e664bad21164a2e163f4a8d9023e84311 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
  *
- * Copyright (C) 2002-2007 Aleph One Ltd.
+ * Copyright (C) 2002-2010 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
  *
  * Created by Charles Manning <charles@aleph1.co.uk>
@@ -11,9 +11,6 @@
  * published by the Free Software Foundation.
  */
 
-const char *yaffs_mtdif_c_version =
-       "$Id: yaffs_mtdif.c,v 1.25 2010-02-19 01:06:31 charles Exp $";
-
 #include "yportenv.h"
 
 
@@ -26,19 +23,19 @@ const char *yaffs_mtdif_c_version =
 
 #include "yaffs_linux.h"
 
-int nandmtd_EraseBlockInNAND(yaffs_Device *dev, int blockNumber)
+int nandmtd_EraseBlockInNAND(yaffs_dev_t *dev, int blockNumber)
 {
-       struct mtd_info *mtd = yaffs_DeviceToContext(dev)->mtd;
+       struct mtd_info *mtd = yaffs_dev_to_mtd(dev);
        __u32 addr =
-           ((loff_t) blockNumber) * dev->param.totalBytesPerChunk
-               * dev->param.nChunksPerBlock;
+           ((loff_t) blockNumber) * dev->param.total_bytes_per_chunk
+               * dev->param.chunks_per_block;
        struct erase_info ei;
        
        int retval = 0;
 
        ei.mtd = mtd;
        ei.addr = addr;
-       ei.len = dev->param.totalBytesPerChunk * dev->param.nChunksPerBlock;
+       ei.len = dev->param.total_bytes_per_chunk * dev->param.chunks_per_block;
        ei.time = 1000;
        ei.retries = 2;
        ei.callback = NULL;
@@ -52,7 +49,7 @@ int nandmtd_EraseBlockInNAND(yaffs_Device *dev, int blockNumber)
                return YAFFS_FAIL;
 }
 
-int nandmtd_InitialiseNAND(yaffs_Device *dev)
+int nandmtd_InitialiseNAND(yaffs_dev_t *dev)
 {
        return YAFFS_OK;
 }