* The AG-AND chips have nice features for speed improvement,
* which are not supported yet. Read / program 4 pages in one go.
*
- * $Id: nand_base.c,v 1.115 2004/08/09 13:19:45 dwmw2 Exp $
+ * $Id: nand_base.c,v 1.113 2004/07/14 16:31:31 gleixner Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
#include <linux/bitops.h>
#include <asm/io.h>
-#ifdef CONFIG_MTD_PARTITIONS
+#if defined(CONFIG_MTD_PARTITIONS) || defined(CONFIG_MTD_PARTITIONS_MODULE)
#include <linux/mtd/partitions.h>
#endif
nand_release_chip(mtd);
/*
- * Return success, if no ECC failures, else -EBADMSG
+ * Return success, if no ECC failures, else -EIO
* fs driver will take care of that, because
- * retlen == desired len and result == -EBADMSG
+ * retlen == desired len and result == -EIO
*/
*retlen = read;
- return ecc_failed ? -EBADMSG : 0;
+ return ecc_failed ? -EIO : 0;
}
/**
ret = instr->state == MTD_ERASE_DONE ? 0 : -EIO;
/* Do call back function */
- if (!ret)
- mtd_erase_callback(instr);
+ if (!ret && instr->callback)
+ instr->callback (instr);
/* Deselect and wake up anyone waiting on the device */
nand_release_chip(mtd);
{
struct nand_chip *this = mtd->priv;
-#ifdef CONFIG_MTD_PARTITIONS
- /* Deregister partitions */
+#if defined(CONFIG_MTD_PARTITIONS) || defined(CONFIG_MTD_PARTITIONS_MODULE)
+ /* Unregister partitions */
del_mtd_partitions (mtd);
#endif
- /* Deregister the device */
+ /* Unregister the device */
del_mtd_device (mtd);
/* Free bad block table memory, if allocated */