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

Marek Vasut marex at denx.de
Sun Nov 29 14:35:41 CET 2015


On Sunday, November 29, 2015 at 12:38:23 PM, Thomas Chou wrote:
> Fix erase and write error code, which should be "protected".

Can you elaborate on why do you think this change is correct please ?
That reasoning should be part of the patch description.

> 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;
>  }

Best regards,
Marek Vasut


More information about the U-Boot mailing list