Message ID | aab1376d1da139c8e347bb40e6561ec3b7359dbc.1615523176.git.Takahiro.Kuwano@infineon.com |
---|---|
State | Superseded |
Delegated to: | Ambarus Tudor |
Headers | show |
Series | mtd: spi-nor: Add support for Cypress s25hl-t/s25hs-t | expand |
On 12/03/21 06:42PM, tkuw584924@gmail.com wrote: > From: Takahiro Kuwano <Takahiro.Kuwano@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@ti.com> > > Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@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 >
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);