[PATCH] flash_eraseall: only add cleanmarkers on known flashtypes
Artem Bityutskiy
dedekind at infradead.org
Tue Mar 24 02:02:16 EDT 2009
On Mon, 2009-03-23 at 23:42 +0100, Sebastian Andrzej Siewior wrote:
> + switch (meminfo->type) {
> + case MTD_ROM:
> + case MTD_RAM:
> + case MTD_NORFLASH:
> cleanmarker.totlen = cpu_to_je32(sizeof(struct
> jffs2_unknown_node));
> - else {
> - struct nand_oobinfo oobinfo;
> + break;
> +
> + case MTD_DATAFLASH:
> + case MTD_UBIVOLUME:
> + fprintf(stderr, "JFFS2 layout not supported on this
> flash.\n");
> + return -1;
> + break;
This should also include MLC NAND flash. To make you nice patches
even better you should call MEMGETOOBSEL ioctl in case of NAND and
check if there is really enough bytes for clean-marker.
But I guess you do not have to do this.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
More information about the linux-mtd
mailing list