[U-Boot] [PATCH 2/5] mtd: spi_flash: Support clearing status register
Jagan Teki
jagannadh.teki at gmail.com
Mon Oct 9 09:45:55 UTC 2017
On Sun, Oct 1, 2017 at 6:50 AM, Ahmed Samir Khalil
<engkhalil86 at gmail.com> wrote:
> A function to clear status register-1 after error
> flag(s) being triggered.
>
> Signed-off-by: Ahmed S. Khalil <engkhalil86 at gmail.com>
> ---
> drivers/mtd/spi/spi_flash.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> index 34f6888..52dcb84 100644
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -110,6 +110,27 @@ static int write_cr(struct spi_flash *flash, u8 wc)
>
> return 0;
> }
> +
> +/*
> + * Clear status register-1
> + *
> + * TODO: Check validity for the other flash vendors.
> + */
> +static int clear_sr(struct spi_flash *flash)
> +{
> + struct spi_slave *spi = flash->spi;
> + u8 cmd, buf;
> + int ret;
> +
> + cmd = CMD_CLEAR_STATUS;
> + ret = spi_flash_cmd_write(spi, cmd, 1, buf, 1);
This is wrong, we should have clear status value to clear the status,
and why we need this operation? doesn't mentioned on commit message?
and all these 5 patches does same job better to squash as one resend.
thanks!
--
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
More information about the U-Boot
mailing list