X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_mtdif.c;h=edc152575302e72a2339e58a730e57e40e028bcc;hp=4fc765ce38a467550487a998b432582a0388a80c;hb=80d031a7c6cbfc952e9646c5cc3c838ddb4d073f;hpb=c40fdc4bd58a06dd160a9a967bbbdc5c5406e090 diff --git a/yaffs_mtdif.c b/yaffs_mtdif.c index 4fc765c..edc1525 100644 --- a/yaffs_mtdif.c +++ b/yaffs_mtdif.c @@ -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-2011 Aleph One Ltd. * for Toby Churchill Ltd and Brightstar Engineering * * Created by Charles Manning @@ -11,12 +11,8 @@ * 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" - #include "yaffs_mtdif.h" #include "linux/mtd/mtd.h" @@ -26,19 +22,18 @@ const char *yaffs_mtdif_c_version = #include "yaffs_linux.h" -int nandmtd_EraseBlockInNAND(yaffs_Device *dev, int blockNumber) +int nandmtd_erase_block(struct yaffs_dev *dev, int block_no) { - struct mtd_info *mtd = yaffs_DeviceToContext(dev)->mtd; - __u32 addr = - ((loff_t) blockNumber) * dev->param.totalBytesPerChunk - * dev->param.nChunksPerBlock; + struct mtd_info *mtd = yaffs_dev_to_mtd(dev); + u32 addr = + ((loff_t) block_no) * 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; @@ -48,12 +43,11 @@ int nandmtd_EraseBlockInNAND(yaffs_Device *dev, int blockNumber) if (retval == 0) return YAFFS_OK; - else - return YAFFS_FAIL; + + return YAFFS_FAIL; } -int nandmtd_InitialiseNAND(yaffs_Device *dev) +int nandmtd_initialise(struct yaffs_dev *dev) { return YAFFS_OK; } -