From: Thomas Chou Date: Sun, 29 Nov 2015 19:38:23 +0800 Subject: [U-Boot] [PATCH 2/2] altera_qspi: fix erase and write error code In-Reply-To: <1448797103-30524-1-git-send-email-thomas@wytron.com.tw> References: <1448797103-30524-1-git-send-email-thomas@wytron.com.tw> Message-ID: <1448797103-30524-2-git-send-email-thomas@wytron.com.tw> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Fix erase and write error code, which should be "protected". Signed-off-by: Thomas Chou --- 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