mtd/drivers/mtd mtdchar.c,1.58,1.59
gleixner at infradead.org
gleixner at infradead.org
Fri Jun 4 10:43:22 EDT 2004
Update of /home/cvs/mtd/drivers/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv31194
Modified Files:
mtdchar.c
Log Message:
Add ioctls for oob and bad block handling. Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
Index: mtdchar.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/mtdchar.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- mtdchar.c 20 Apr 2004 12:22:35 -0000 1.58
+++ mtdchar.c 4 Jun 2004 14:43:19 -0000 1.59
@@ -454,7 +454,40 @@
return -EFAULT;
break;
}
+
+ case MEMGETOOBSEL:
+ {
+ if (copy_to_user((struct nand_oobinfo *) arg, &(mtd->oobinfo), sizeof(struct nand_oobinfo)))
+ return -EFAULT;
+ break;
+ }
+
+ case MEMGETBADBLOCK:
+ {
+ loff_t offs;
+ if (copy_from_user(&offs ,(void *)arg, sizeof(loff_t)))
+ return -EFAULT;
+ if (!mtd->block_isbad)
+ ret = -EOPNOTSUPP;
+ else
+ return mtd->block_isbad(mtd, offs);
+ break;
+ }
+
+ case MEMSETBADBLOCK:
+ {
+ loff_t offs;
+
+ if (copy_from_user(&offs ,(void *)arg, sizeof(loff_t)))
+ return -EFAULT;
+ if (!mtd->block_markbad)
+ ret = -EOPNOTSUPP;
+ else
+ return mtd->block_markbad(mtd, offs);
+ break;
+ }
+
default:
DEBUG(MTD_DEBUG_LEVEL0, "Invalid ioctl %x (MEMGETINFO = %x)\n", cmd, MEMGETINFO);
ret = -ENOTTY;
More information about the linux-mtd-cvs
mailing list