X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_mtdif1.c;h=aaa02db2f66592cd82d69aa13d8bd3c3e07cf6ab;hp=16171e09ba7b9aa9cdf5a9674fea5d279267737d;hb=1c8401d1235c9771c4086aa75e31c56c5cac121c;hpb=30ab3ff5e311e8e2b488c3f62f30e7450dc6bee9 diff --git a/yaffs_mtdif1.c b/yaffs_mtdif1.c index 16171e0..aaa02db 100644 --- a/yaffs_mtdif1.c +++ b/yaffs_mtdif1.c @@ -2,7 +2,7 @@ * YAFFS: Yet another FFS. A NAND-flash specific file system. * yaffs_mtdif1.c NAND mtd interface functions for small-page NAND. * - * Copyright (C) 2002 Aleph One Ltd. + * Copyright (C) 2002-2010 Aleph One Ltd. * for Toby Churchill Ltd and Brightstar Engineering * * This program is free software; you can redistribute it and/or modify @@ -38,8 +38,6 @@ /* Don't compile this module if we don't have MTD's mtd_oob_ops interface */ #if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17)) -const char *yaffs_mtdif1_c_version = "$Id: yaffs_mtdif1.c,v 1.13 2010-02-18 01:18:04 charles Exp $"; - #ifndef CONFIG_YAFFS_9BYTE_TAGS # define YTAG1_SIZE 8 #else @@ -137,9 +135,9 @@ int nandmtd1_WriteChunkWithTagsToNAND(yaffs_Device *dev, retval = mtd->write_oob(mtd, addr, &ops); if (retval) { - yaffs_trace(YAFFS_TRACE_MTD, - "write_oob failed, chunk %d, mtd error %d\n", - chunkInNAND, retval); + T(YAFFS_TRACE_MTD, + (TSTR("write_oob failed, chunk %d, mtd error %d"TENDSTR), + chunkInNAND, retval)); } return retval ? YAFFS_FAIL : YAFFS_OK; } @@ -198,9 +196,9 @@ int nandmtd1_ReadChunkWithTagsFromNAND(yaffs_Device *dev, */ retval = mtd->read_oob(mtd, addr, &ops); if (retval) { - yaffs_trace(YAFFS_TRACE_MTD, - "read_oob failed, chunk %d, mtd error %d\n", - chunkInNAND, retval); + T(YAFFS_TRACE_MTD, + (TSTR("read_oob failed, chunk %d, mtd error %d"TENDSTR), + chunkInNAND, retval)); } switch (retval) { @@ -286,7 +284,7 @@ int nandmtd1_MarkNANDBlockBad(struct yaffs_DeviceStruct *dev, int blockNo) int blocksize = dev->param.nChunksPerBlock * dev->nDataBytesPerChunk; int retval; - yaffs_trace(YAFFS_TRACE_BAD_BLOCKS, "marking block %d bad\n", blockNo); + T(YAFFS_TRACE_BAD_BLOCKS,(TSTR("marking block %d bad"TENDSTR), blockNo)); retval = mtd->block_markbad(mtd, (loff_t)blocksize * blockNo); return (retval) ? YAFFS_FAIL : YAFFS_OK; @@ -303,9 +301,9 @@ static int nandmtd1_TestPrerequists(struct mtd_info *mtd) int oobavail = mtd->ecclayout->oobavail; if (oobavail < YTAG1_SIZE) { - yaffs_trace(YAFFS_TRACE_ERROR, - "mtd device has only %d bytes for tags, need %d\n", - oobavail, YTAG1_SIZE); + T(YAFFS_TRACE_ERROR, + (TSTR("mtd device has only %d bytes for tags, need %d"TENDSTR), + oobavail, YTAG1_SIZE)); return YAFFS_FAIL; } return YAFFS_OK; @@ -340,8 +338,8 @@ int nandmtd1_QueryNANDBlock(struct yaffs_DeviceStruct *dev, int blockNo, retval = nandmtd1_ReadChunkWithTagsFromNAND(dev, chunkNo, NULL, &etags); etags.blockBad = (mtd->block_isbad)(mtd, addr); if (etags.blockBad) { - yaffs_trace(YAFFS_TRACE_BAD_BLOCKS, - "block %d is marked bad\n", blockNo); + T(YAFFS_TRACE_BAD_BLOCKS, + (TSTR("block %d is marked bad"TENDSTR), blockNo)); state = YAFFS_BLOCK_STATE_DEAD; } else if (etags.eccResult != YAFFS_ECC_RESULT_NO_ERROR) { /* bad tags, need to look more closely */