From: Øyvind H. <go...@us...> - 2010-05-18 09:23:59
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via fafed75d9831c8038c5504fc94e941f0ee9770e5 (commit) from 3ecc191b361d913d3bdf156568454de57f093aee (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit fafed75d9831c8038c5504fc94e941f0ee9770e5 Author: Jon Povey <jon...@ra...> Date: Mon May 17 16:15:35 2010 +0900 NAND: catch read errors when building BBT nand_build_bbt() was ignoring the return value from nand_read_page() and blindly continuing. It now passes the return value up to the caller if the read fails. Signed-off-by: Jon Povey <jon...@ra...> diff --git a/src/flash/nand/core.c b/src/flash/nand/core.c index 44b13ce..b3220e2 100644 --- a/src/flash/nand/core.c +++ b/src/flash/nand/core.c @@ -226,6 +226,7 @@ int nand_build_bbt(struct nand_device *nand, int first, int last) int i; int pages_per_block = (nand->erase_size / nand->page_size); uint8_t oob[6]; + int ret; if ((first < 0) || (first >= nand->num_blocks)) first = 0; @@ -236,7 +237,9 @@ int nand_build_bbt(struct nand_device *nand, int first, int last) page = first * pages_per_block; for (i = first; i <= last; i++) { - nand_read_page(nand, page, NULL, 0, oob, 6); + ret = nand_read_page(nand, page, NULL, 0, oob, 6); + if (ret != ERROR_OK) + return ret; if (((nand->device->options & NAND_BUSWIDTH_16) && ((oob[0] & oob[1]) != 0xff)) || (((nand->page_size == 512) && (oob[5] != 0xff)) || ----------------------------------------------------------------------- Summary of changes: src/flash/nand/core.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) hooks/post-receive -- Main OpenOCD repository |