2 * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
4 * Copyright (C) 2002-2010 Aleph One Ltd.
5 * for Toby Churchill Ltd and Brightstar Engineering
7 * Created by Charles Manning <charles@aleph1.co.uk>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
16 #include "yaffs_mtdif.h"
18 #include "linux/mtd/mtd.h"
19 #include "linux/types.h"
20 #include "linux/time.h"
21 #include "linux/mtd/nand.h"
23 #include "yaffs_linux.h"
25 int nandmtd_erase_block(struct yaffs_dev *dev, int block_no)
27 struct mtd_info *mtd = yaffs_dev_to_mtd(dev);
29 ((loff_t) block_no) * dev->param.total_bytes_per_chunk
30 * dev->param.chunks_per_block;
37 ei.len = dev->param.total_bytes_per_chunk * dev->param.chunks_per_block;
41 ei.priv = (u_long) dev;
43 retval = mtd->erase(mtd, &ei);
51 int nandmtd_initialise(struct yaffs_dev *dev)