[U-Boot] [PATCH 2/2] altera_qspi: fix erase and write error code

Thomas Chou thomas at wytron.com.tw
Sun Nov 29 12:38:23 CET 2015


Fix erase and write error code, which should be "protected".

Signed-off-by: Thomas Chou <thomas at wytron.com.tw>
---
 drivers/mtd/altera_qspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c
index 89f04a4..cf45e73 100644
--- a/drivers/mtd/altera_qspi.c
+++ b/drivers/mtd/altera_qspi.c
@@ -77,7 +77,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
 	instr.len = mtd->erasesize * (s_last + 1 - s_first);
 	ret = mtd_erase(mtd, &instr);
 	if (ret)
-		return ERR_NOT_ERASED;
+		return ERR_PROTECTED;
 
 	return 0;
 }
@@ -94,7 +94,7 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
 
 	ret = mtd_write(mtd, to, cnt, &retlen, src);
 	if (ret)
-		return ERR_NOT_ERASED;
+		return ERR_PROTECTED;
 
 	return 0;
 }
-- 
2.5.0



More information about the U-Boot mailing list