[PATCH v3 2/6] mtd: spi-nor: core: Expose spi_nor_clear_sr() to manufacturer drivers
Pratyush Yadav
p.yadav at ti.com
Mon Mar 15 10:54:13 GMT 2021
On 12/03/21 06:42PM, tkuw584924 at gmail.com wrote:
> From: Takahiro Kuwano <Takahiro.Kuwano at infineon.com>
>
> spi_nor_clear_sr() needs to be called from manufacturer drivers that
> implement the ->ready() hook.
I would expect flashes that need a custom method to read sr would also
need a custom one to clear it. But maybe that is not the case.
Reviewed-by: Pratyush Yadav <p.yadav at ti.com>
>
> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano at infineon.com>
> ---
> Changes in v3:
> - New in v3
>
> drivers/mtd/spi-nor/core.c | 2 +-
> drivers/mtd/spi-nor/core.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index c8a7f246ab7d..3ca199bb83e3 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -653,7 +653,7 @@ static int spi_nor_xsr_ready(struct spi_nor *nor)
> * spi_nor_clear_sr() - Clear the Status Register.
> * @nor: pointer to 'struct spi_nor'.
> */
> -static void spi_nor_clear_sr(struct spi_nor *nor)
> +void spi_nor_clear_sr(struct spi_nor *nor)
> {
> int ret;
>
> diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
> index 4d06c27630fe..596480aef924 100644
> --- a/drivers/mtd/spi-nor/core.h
> +++ b/drivers/mtd/spi-nor/core.h
> @@ -447,6 +447,7 @@ int spi_nor_read_cr(struct spi_nor *nor, u8 *cr);
> int spi_nor_write_sr(struct spi_nor *nor, const u8 *sr, size_t len);
> int spi_nor_write_sr_and_check(struct spi_nor *nor, u8 sr1);
>
> +void spi_nor_clear_sr(struct spi_nor *nor);
> int spi_nor_xread_sr(struct spi_nor *nor, u8 *sr);
> ssize_t spi_nor_read_data(struct spi_nor *nor, loff_t from, size_t len,
> u8 *buf);
> --
> 2.25.1
>
--
Regards,
Pratyush Yadav
Texas Instruments Inc.
More information about the linux-mtd
mailing list