yaffs u-boot: Fix erase for inband tags. fix-uboot pre-driver-refactoring
authorCharles Manning <cdhmanning@gmail.com>
Wed, 29 Aug 2012 19:28:39 +0000 (07:28 +1200)
committerCharles Manning <cdhmanning@gmail.com>
Wed, 29 Aug 2012 19:28:39 +0000 (07:28 +1200)
Yaffs u-boot with inband tags was not working properly. Fixed.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
direct/u-boot/fs/yaffs2/yaffs_mtdif.c

index db49052..b7ec909 100644 (file)
@@ -66,7 +66,7 @@ int nandmtd_WriteChunkToNAND(struct yaffs_dev *dev, int chunkInNAND,
        struct mtd_oob_ops ops;
        size_t dummy;
        int retval = 0;
-       loff_t addr = ((loff_t) chunkInNAND) * dev->data_bytes_per_chunk;
+       loff_t addr = ((loff_t) chunkInNAND) * dev->param.total_bytes_per_chunk;
        u8 spareAsBytes[8]; /* OOB */
 
        if (data && !spare)
@@ -102,7 +102,7 @@ int nandmtd_ReadChunkFromNAND(struct yaffs_dev *dev, int chunkInNAND, u8 *data,
        size_t dummy;
        int retval = 0;
 
-       loff_t addr = ((loff_t) chunkInNAND) * dev->data_bytes_per_chunk;
+       loff_t addr = ((loff_t) chunkInNAND) * dev->param.total_bytes_per_chunk;
        u8 spareAsBytes[8]; /* OOB */
 
        if (data && !spare)
@@ -135,7 +135,7 @@ int nandmtd_EraseBlockInNAND(struct yaffs_dev *dev, int blockNumber)
 {
        struct mtd_info *mtd = (struct mtd_info *)(dev->driver_context);
        __u32 addr =
-           ((loff_t) blockNumber) * dev->data_bytes_per_chunk
+           ((loff_t) blockNumber) * dev->param.total_bytes_per_chunk
                * dev->param.chunks_per_block;
        struct erase_info ei;
        int retval = 0;