From 4483117a60b1659fccf27e259121725017ba5f12 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 25 Nov 2013 14:16:04 -0600 Subject: [PATCH] SAMA5 NAND: Trivial changes --- arch/arm/src/sama5/sam_nand.c | 9 ++++++--- drivers/mtd/mtd_nandmodel.c | 10 +++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/arch/arm/src/sama5/sam_nand.c b/arch/arm/src/sama5/sam_nand.c index a1dd18f368..8a5a73f543 100644 --- a/arch/arm/src/sama5/sam_nand.c +++ b/arch/arm/src/sama5/sam_nand.c @@ -644,7 +644,7 @@ static void nand_wait_cmddone(struct sam_nandcs_s *priv) /* Wait for the CMDDONE interrupt to occur */ flags = irqsave(); - while (!g_nand.cmddone) + do { ret = sem_wait(&g_nand.waitsem); if (ret < 0) @@ -652,6 +652,7 @@ static void nand_wait_cmddone(struct sam_nandcs_s *priv) DEBUGASSERT(errno == EINTR); } } + while (!g_nand.cmddone); /* Disable further CMDDONE interrupts */ @@ -717,7 +718,7 @@ static void nand_wait_xfrdone(struct sam_nandcs_s *priv) /* Wait for the XFRDONE interrupt to occur */ flags = irqsave(); - while (!g_nand.xfrdone) + do { ret = sem_wait(&g_nand.waitsem); if (ret < 0) @@ -725,6 +726,7 @@ static void nand_wait_xfrdone(struct sam_nandcs_s *priv) DEBUGASSERT(errno == EINTR); } } + while (!g_nand.xfrdone); /* Disable further XFRDONE interrupts */ @@ -790,7 +792,7 @@ static void nand_wait_rbedge(struct sam_nandcs_s *priv) /* Wait for the RBEDGE interrupt to occur */ flags = irqsave(); - while (!g_nand.rbedge) + do { ret = sem_wait(&g_nand.waitsem); if (ret < 0) @@ -798,6 +800,7 @@ static void nand_wait_rbedge(struct sam_nandcs_s *priv) DEBUGASSERT(errno == EINTR); } } + while (!g_nand.rbedge); /* Disable further RBEDGE interrupts */ diff --git a/drivers/mtd/mtd_nandmodel.c b/drivers/mtd/mtd_nandmodel.c index 48492bbc26..ec89accb70 100644 --- a/drivers/mtd/mtd_nandmodel.c +++ b/drivers/mtd/mtd_nandmodel.c @@ -157,11 +157,11 @@ int nandmodel_find(FAR const struct nand_model_s *modeltab, size_t size, } fvdbg("NAND Model found:\n"); - fvdbg(" devid: 0x%02x\n", model->devid); - fvdbg(" devsize: %d\n", model->devsize); - fvdbg(" blocksize: %d\n", model->blocksize); - fvdbg(" pagesize: %d\n", model->pagesize); - fvdbg(" options: 0x%02x\n", model->options); + fvdbg(" devid: 0x%02x\n", model->devid); + fvdbg(" devsize: %d (MB)\n", model->devsize); + fvdbg(" blocksize: %d (KB)\n", model->blocksize); + fvdbg(" pagesize: %d (B)\n", model->pagesize); + fvdbg(" options: 0x%02x\n", model->options); break; } }